From 26f85086fd0c84103f330b32833d7ff153a2c074 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Thu, 24 Feb 2022 19:42:10 +0000 Subject: [PATCH] ansible-host: Use FQCN names for modules --- roles/ansible-host/tasks/main.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/roles/ansible-host/tasks/main.yml b/roles/ansible-host/tasks/main.yml index a62bfd1..be47d84 100644 --- a/roles/ansible-host/tasks/main.yml +++ b/roles/ansible-host/tasks/main.yml @@ -1,11 +1,6 @@ --- -- name: check support - fail: - msg: Role not supported in your system - when: ansible_os_family != "RedHat" - - name: install ansible packages - package: + ansible.builtin.package: name: "{{ item }}" state: installed with_items: @@ -15,7 +10,7 @@ - python3-netaddr # required by iptables role - name: create private directory and force permissions - file: + ansible.builtin.file: path: /export/private owner: root group: root @@ -23,7 +18,7 @@ state: directory - name: link private directory - file: + ansible.builtin.file: src: "/export/private" dest: "/srv/private" owner: root @@ -32,17 +27,17 @@ follow: false - name: allow http server to access /srv/ansible - sefcontext: + community.general.sefcontext: path: /srv/ansible(/.*)? setype: httpd_sys_content_t - name: clone ansible repository - git: + ansible.builtin.git: dest: /srv/ansible repo: https://git.foo.sh/ansible.git update: false - name: link facts to nginx - file: + ansible.builtin.file: src: "/srv/ansible/facts" dest: "/srv/web/{{ inventory_hostname }}/facts" owner: root @@ -51,7 +46,7 @@ follow: false - name: create nginx conf - copy: + ansible.builtin.copy: src: nginx.conf dest: /etc/nginx/conf.d/{{ inventory_hostname }}/ansible.conf mode: 0644 @@ -60,7 +55,7 @@ notify: restart nginx - name: add custom .bashrc for root - copy: + ansible.builtin.copy: dest: /root/.bashrc src: root-bashrc.sh owner: root