--- - name: HTTPS APT transport for Elasticsearch repository. apt: name: apt-transport-https state: present - name: Add Elasticsearch apt key. apt_key: url: https://artifacts.elastic.co/GPG-KEY-elasticsearch state: present - name: Add Elasticsearch repository. apt_repository: repo: 'deb https://artifacts.elastic.co/packages/{{ elasticsearch_version }}/apt stable main' state: present update_cache: true