ansible-host: Use FQCN names for modules

This commit is contained in:
Timo Makinen 2022-02-24 19:42:10 +00:00
parent e59f52b410
commit 26f85086fd

View file

@ -1,11 +1,6 @@
--- ---
- name: check support
fail:
msg: Role not supported in your system
when: ansible_os_family != "RedHat"
- name: install ansible packages - name: install ansible packages
package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: installed state: installed
with_items: with_items:
@ -15,7 +10,7 @@
- python3-netaddr # required by iptables role - python3-netaddr # required by iptables role
- name: create private directory and force permissions - name: create private directory and force permissions
file: ansible.builtin.file:
path: /export/private path: /export/private
owner: root owner: root
group: root group: root
@ -23,7 +18,7 @@
state: directory state: directory
- name: link private directory - name: link private directory
file: ansible.builtin.file:
src: "/export/private" src: "/export/private"
dest: "/srv/private" dest: "/srv/private"
owner: root owner: root
@ -32,17 +27,17 @@
follow: false follow: false
- name: allow http server to access /srv/ansible - name: allow http server to access /srv/ansible
sefcontext: community.general.sefcontext:
path: /srv/ansible(/.*)? path: /srv/ansible(/.*)?
setype: httpd_sys_content_t setype: httpd_sys_content_t
- name: clone ansible repository - name: clone ansible repository
git: ansible.builtin.git:
dest: /srv/ansible dest: /srv/ansible
repo: https://git.foo.sh/ansible.git repo: https://git.foo.sh/ansible.git
update: false update: false
- name: link facts to nginx - name: link facts to nginx
file: ansible.builtin.file:
src: "/srv/ansible/facts" src: "/srv/ansible/facts"
dest: "/srv/web/{{ inventory_hostname }}/facts" dest: "/srv/web/{{ inventory_hostname }}/facts"
owner: root owner: root
@ -51,7 +46,7 @@
follow: false follow: false
- name: create nginx conf - name: create nginx conf
copy: ansible.builtin.copy:
src: nginx.conf src: nginx.conf
dest: /etc/nginx/conf.d/{{ inventory_hostname }}/ansible.conf dest: /etc/nginx/conf.d/{{ inventory_hostname }}/ansible.conf
mode: 0644 mode: 0644
@ -60,7 +55,7 @@
notify: restart nginx notify: restart nginx
- name: add custom .bashrc for root - name: add custom .bashrc for root
copy: ansible.builtin.copy:
dest: /root/.bashrc dest: /root/.bashrc
src: root-bashrc.sh src: root-bashrc.sh
owner: root owner: root