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
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