feat: remove reference to a specific user
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
12532110b7
commit
885a1388d9
@ -21,6 +21,7 @@ system_user:
|
|||||||
home: /home/ansible
|
home: /home/ansible
|
||||||
shell: '/bin/bash'
|
shell: '/bin/bash'
|
||||||
system_group: []
|
system_group: []
|
||||||
|
system_sudoers_group: "superusergroup"
|
||||||
keystodeploy: []
|
keystodeploy: []
|
||||||
# - name: toto
|
# - name: toto
|
||||||
# user: toto
|
# user: toto
|
||||||
|
@ -53,11 +53,3 @@
|
|||||||
update_cache: true
|
update_cache: true
|
||||||
become: true
|
become: true
|
||||||
when: ansible_facts['os_family'] == "RedHat"
|
when: ansible_facts['os_family'] == "RedHat"
|
||||||
|
|
||||||
#- name: Pass user shell to zsh
|
|
||||||
# user:
|
|
||||||
# name: "{{ user.name }}"
|
|
||||||
# shell: /bin/zsh
|
|
||||||
# state: present
|
|
||||||
# when: ansible_facts['os_family'] != "RedHat"
|
|
||||||
# become: true
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
owner: '{{ item }}'
|
owner: '{{ item }}'
|
||||||
mode: 0700
|
mode: 0700
|
||||||
with_items:
|
with_items:
|
||||||
- '{{ user.name }}'
|
|
||||||
- ansible
|
- ansible
|
||||||
|
|
||||||
- name: Copy ssh config for user
|
- name: Copy ssh config for user
|
||||||
@ -25,7 +24,6 @@
|
|||||||
selevel: s0
|
selevel: s0
|
||||||
owner: '{{ item }}'
|
owner: '{{ item }}'
|
||||||
with_items:
|
with_items:
|
||||||
- '{{ user.name }}'
|
|
||||||
- ansible
|
- ansible
|
||||||
- name: Ensure root ssh directory exist
|
- name: Ensure root ssh directory exist
|
||||||
become: true
|
become: true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: Set sudoers right
|
- name: Set sudoers right
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
dest: '/etc/sudoers.d/{{ user.name }}'
|
dest: '/etc/sudoers.d/{{ system_sudoers_group }}'
|
||||||
regexp: '{{ item.regexp }}'
|
regexp: '{{ item.regexp }}'
|
||||||
line: '{{ item.line }}'
|
line: '{{ item.line }}'
|
||||||
state: 'present'
|
state: 'present'
|
||||||
@ -10,8 +10,8 @@
|
|||||||
mode: '0440'
|
mode: '0440'
|
||||||
validate: 'visudo -cf "%s"'
|
validate: 'visudo -cf "%s"'
|
||||||
with_items:
|
with_items:
|
||||||
- regexp: '^{{ user.name }}\s'
|
- regexp: '^%{{ system_sudoers_group }}\s'
|
||||||
line: '{{ user.name }} ALL = (ALL) NOPASSWD:ALL'
|
line: '%{{ system_sudoers_group }} ALL = (ALL) NOPASSWD:ALL'
|
||||||
become: True
|
become: True
|
||||||
|
|
||||||
- name: Change secure path
|
- name: Change secure path
|
||||||
|
Loading…
Reference in New Issue
Block a user