diff --git a/handlers/main.yml b/handlers/main.yml index cad5ecd..9327e9e 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: restart elasticsearch - systemd: + ansible.builtin.service: name: elasticsearch state: restarted diff --git a/tasks/config.yml b/tasks/config.yml index 08db1da..aaaa499 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,6 +1,6 @@ --- - name: set heap size - lineinfile: + ansible.builtin.lineinfile: path: /etc/elasticsearch/jvm.options regexp: '^-{{ item }}' line: '-{{ item }}{{ elasticsearch_heap_size }}' @@ -11,7 +11,7 @@ tags: elasticsearch - name: copy config file - copy: + ansible.builtin.copy: content: '{{ elasticsearch_full_config|to_yaml }}' dest: /etc/elasticsearch/elasticsearch.yml owner: root diff --git a/tasks/packages.yml b/tasks/packages.yml index d166d9f..7d76ca5 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -1,6 +1,6 @@ --- - name: install dependencies packages - package: + ansible.builtin.package: name: - apt-transport-https - python3-requests @@ -10,7 +10,7 @@ tags: elasticsearch - name: add repository key - apt_key: + ansible.builtin.apt_key: url: https://artifacts.elastic.co/GPG-KEY-elasticsearch retries: 2 register: result @@ -18,12 +18,12 @@ tags: elasticsearch - name: add repository - apt_repository: + ansible.builtin.apt_repository: repo: deb https://artifacts.elastic.co/packages/7.x/apt stable main tags: elasticsearch - name: install package - package: + ansible.builtin.package: name: - elasticsearch retries: 2 diff --git a/tasks/service.yml b/tasks/service.yml index 6b54c36..8729e04 100644 --- a/tasks/service.yml +++ b/tasks/service.yml @@ -1,13 +1,13 @@ --- - name: enable and start service - systemd: + ansible.builtin.service: name: elasticsearch state: started enabled: true tags: elasticsearch - name: wait for api is available - wait_for: + ansible.builtin.wait_for: port: 9200 timeout: 10 tags: elasticsearch