ansible_host: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-29 17:41:23 +00:00
parent 24c76d875b
commit 9ddb043290

View file

@ -1,5 +1,5 @@
--- ---
- name: install ansible packages - name: Install packages
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: installed state: installed
@ -7,10 +7,10 @@
- ansible - ansible
- ansible-collection-ansible-posix - ansible-collection-ansible-posix
- ansible-collection-community-general - ansible-collection-community-general
- python3-dns # required for lookup('dig', 'hostname') - python3-dns # required for lookup('dig', 'hostname')
- python38-netaddr # required by iptables role - python38-netaddr # required by iptables role
- name: create private directory and force permissions - name: Create private directory and force permissions
ansible.builtin.file: ansible.builtin.file:
path: /export/private path: /export/private
owner: root owner: root
@ -18,26 +18,27 @@
mode: 0700 mode: 0700
state: directory state: directory
- name: link private directory - name: Link private directory
ansible.builtin.file: ansible.builtin.file:
src: "/export/private" src: /export/private
dest: "/srv/private" dest: /srv/private
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
state: link state: link
follow: false follow: false
- name: allow http server to access /srv/ansible - name: Allow http server to access /srv/ansible
community.general.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
ansible.builtin.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
ansible.builtin.file: ansible.builtin.file:
src: "/srv/ansible/facts" src: "/srv/ansible/facts"
dest: "/srv/web/{{ inventory_hostname }}/facts" dest: "/srv/web/{{ inventory_hostname }}/facts"
@ -46,7 +47,7 @@
state: link state: link
follow: false follow: false
- name: create nginx conf - name: Create nginx conf
ansible.builtin.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
@ -55,7 +56,7 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart nginx notify: restart nginx
- name: add custom .bashrc for root - name: Add custom .bashrc for root
ansible.builtin.copy: ansible.builtin.copy:
dest: /root/.bashrc dest: /root/.bashrc
src: root-bashrc.sh src: root-bashrc.sh