autofs: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-29 17:13:04 +00:00
parent 71a7a0ab68
commit 60ba593c17
2 changed files with 17 additions and 17 deletions

View file

@ -1,5 +1,5 @@
--- ---
- name: restart autofs - name: Restart autofs
ansible.builtin.service: ansible.builtin.service:
name: autofs name: autofs
state: restarted state: restarted

View file

@ -1,28 +1,28 @@
--- ---
- name: install packages - name: Install packages
ansible.builtin.package: ansible.builtin.package:
name: autofs name: autofs
state: installed state: installed
- name: allow nfs home directories for selinux - name: Allow NFS home directories for SELinux
ansible.posix.seboolean: ansible.posix.seboolean:
name: use_nfs_home_dirs name: use_nfs_home_dirs
state: true state: true
persistent: true persistent: true
- name: configure ldap server for autofs - name: Configure LDAP server for autofs
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
dest: /etc/autofs.conf dest: /etc/autofs.conf
regexp: '^#?ldap_uri\s*=.*' regexp: '^#?ldap_uri\s*=.*'
line: "ldap_uri = {% for u in ldap_server %}ldaps://{{ u }} {% endfor %}" line: "ldap_uri = {% for u in ldap_server %}ldaps://{{ u }} {% endfor %}"
notify: restart autofs notify: Restart autofs
- name: configure ldap schema for autofs - name: Configure LDAP schema for autofs
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
dest: /etc/autofs.conf dest: /etc/autofs.conf
line: "{{ item }}" line: "{{ item }}"
insertbefore: "^# auth_conf_file" insertbefore: "^# auth_conf_file"
notify: restart autofs notify: Restart autofs
with_items: with_items:
- value_attribute = automountInformation - value_attribute = automountInformation
- entry_attribute = automountKey - entry_attribute = automountKey
@ -30,47 +30,47 @@
- entry_object_class = automount - entry_object_class = automount
- map_object_class = organizationalUnit - map_object_class = organizationalUnit
- name: configure ldap auth for autofs - name: Configure LDAP auth for autofs
ansible.builtin.template: ansible.builtin.template:
dest: /etc/autofs_ldap_auth.conf dest: /etc/autofs_ldap_auth.conf
src: autofs_ldap_auth.conf.j2 src: autofs_ldap_auth.conf.j2
mode: 0600 mode: 0600
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart autofs notify: Restart autofs
- name: create auto.master config - name: Create auto.master config
ansible.builtin.template: ansible.builtin.template:
dest: /etc/auto.master dest: /etc/auto.master
src: auto.master.j2 src: auto.master.j2
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart autofs notify: Restart autofs
- name: start autofs service - name: Start autofs service
ansible.builtin.service: ansible.builtin.service:
name: autofs name: autofs
state: started state: started
enabled: true enabled: true
- name: disable authorized_keys file from users - name: Disable authorized_keys file from users
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
line: AuthorizedKeysFile none line: AuthorizedKeysFile none
regexp: '^AuthorizedKeysFile\s+.*' regexp: '^AuthorizedKeysFile\s+.*'
notify: restart sshd notify: Restart sshd
- name: enable authorized_keys file for root - name: Enable authorized_keys file for root
ansible.builtin.blockinfile: ansible.builtin.blockinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
block: | block: |
Match User root Match User root
AuthorizedKeysFile .ssh/authorized_keys AuthorizedKeysFile .ssh/authorized_keys
marker: "# {mark} ANSIBLE MANAGED BLOCK (root user)" marker: "# {mark} ANSIBLE MANAGED BLOCK (root user)"
notify: restart sshd notify: Restart sshd
- name: move user cache from home directory to tmpfs - name: Move user cache from home directory to tmpfs
ansible.builtin.copy: ansible.builtin.copy:
dest: "/etc/profile.d/{{ item }}" dest: "/etc/profile.d/{{ item }}"
src: "{{ item }}" src: "{{ item }}"