Bladeren bron

move user

master
bovenliggende
commit
a7066a8115
3 gewijzigde bestanden met toevoegingen van 18 en 0 verwijderingen
  1. +3
    -0
      tasks/main.yml
  2. +13
    -0
      tasks/move.yaml
  3. +2
    -0
      tasks/users.yml

+ 3
- 0
tasks/main.yml Bestand weergeven

@@ -5,6 +5,9 @@
- import_tasks: user_groups.yml
when: user_groups is defined

- import_tasks: move.yml
when: users is defined

- import_tasks: users.yml
when: users is defined



+ 13
- 0
tasks/move.yaml Bestand weergeven

@@ -0,0 +1,13 @@
---

- name: move group
command: "groupmod --login {{ item }} {{ users[item].old_name }}"
loop: "{{ users.keys() | list }}"
when: users[item].old_name is defined
failed_when: false

- name: move account
command: "usermod --login {{ item }} {{ users[item].old_name }}"
loop: "{{ users.keys() | list }}"
when: users[item].old_name is defined
failed_when: false

+ 2
- 0
tasks/users.yml Bestand weergeven

@@ -15,6 +15,8 @@
uid: "{{ users[item].uid }}"
home: "{{ users[item].home | default('/home/'+item) }}"
shell: "{{ users[item].shell | default('/usr/bin/fish') }}"
create_home: true
move_home: true
loop: "{{ users.keys() | list }}"
notify: restart systemd-logind.service



Laden…
Annuleren
Opslaan