From 975dd6d8aa7c03b5c891e1b18c46fc2c20b0fa2e Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 15 Jan 2023 11:17:27 +0100 Subject: [PATCH] style: formating --- tasks/main.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 1d9f84f..7c19594 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,22 +2,22 @@ # tasks file for ansible-user - name: Print user name ansible.builtin.debug: - msg: {{ user_name }} + msg: '{{ user_name }}' - name: Create system user become: true ansible.builtin.user: name: '{{ user_name }}' system: true - password: "{{ user_password|default('') }}" + password: "{{ user_password | default('') }}" groups: "{{ user_groups | join(',') }}" home: "{{ user_home | default('/') }}" shell: "{{ user_shell | default('/usr/bin/nologin') }}" when: user_name != "root" and not user_ldap -- name: simulate login - stat: - path: "/home/{{user.name}}" - become: true - become_user: "{{user.name}}" +- name: Simulate login + ansible.builtin.stat: + path: '/home/{{ user.name }}' + become: true + become_user: '{{ user.name }}' when: user_ldap - name: Ensure .ssh exist for user @@ -38,12 +38,11 @@ selevel: s0 owner: '{{ user_name }}' - - name: Install ssh private key become: true ansible.builtin.copy: content: '{{ item.key }}' - dest: '{{ user_home}}/.ssh/{{ item.keyname }}' + dest: '{{ user_home }}/.ssh/{{ item.keyname }}' mode: 0600 owner: '{{ user_name }}' with_items: '{{ user_privatekey }}' @@ -54,5 +53,3 @@ key: '{{ item }}' exclusive: false with_items: '{{ user_authorized_key }}' - -