style: formating
This commit is contained in:
parent
f1b471bc31
commit
975dd6d8aa
@ -2,7 +2,7 @@
|
|||||||
# tasks file for ansible-user
|
# tasks file for ansible-user
|
||||||
- name: Print user name
|
- name: Print user name
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: {{ user_name }}
|
msg: '{{ user_name }}'
|
||||||
- name: Create system user
|
- name: Create system user
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
@ -13,11 +13,11 @@
|
|||||||
home: "{{ user_home | default('/') }}"
|
home: "{{ user_home | default('/') }}"
|
||||||
shell: "{{ user_shell | default('/usr/bin/nologin') }}"
|
shell: "{{ user_shell | default('/usr/bin/nologin') }}"
|
||||||
when: user_name != "root" and not user_ldap
|
when: user_name != "root" and not user_ldap
|
||||||
- name: simulate login
|
- name: Simulate login
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "/home/{{user.name}}"
|
path: '/home/{{ user.name }}'
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{user.name}}"
|
become_user: '{{ user.name }}'
|
||||||
when: user_ldap
|
when: user_ldap
|
||||||
|
|
||||||
- name: Ensure .ssh exist for user
|
- name: Ensure .ssh exist for user
|
||||||
@ -38,7 +38,6 @@
|
|||||||
selevel: s0
|
selevel: s0
|
||||||
owner: '{{ user_name }}'
|
owner: '{{ user_name }}'
|
||||||
|
|
||||||
|
|
||||||
- name: Install ssh private key
|
- name: Install ssh private key
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@ -54,5 +53,3 @@
|
|||||||
key: '{{ item }}'
|
key: '{{ item }}'
|
||||||
exclusive: false
|
exclusive: false
|
||||||
with_items: '{{ user_authorized_key }}'
|
with_items: '{{ user_authorized_key }}'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user