homeserver/roles/mgrote.create_users/tasks/main.yml
Quotengrote 15d783de86
FQCN eingeführt (#70)
* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
2020-11-21 19:41:19 +01:00

43 lines
1.3 KiB
YAML

- name: Erstelle Nutzer
become: yes
ansible.builtin.user:
name: "{{ create_user_name }}"
groups: "{{ create_user_groups }}"
state: present
shell: /bin/bash
password: "{{ create_user_password | password_hash('sha512') }}"
update_password: on_create
# no_log: true
- name: touch ".sudo_as_admin_successful"
become: yes
# when: sudo_as_admin_successful_existiert.stat.exists == False
ansible.builtin.file:
path: /home/{{ create_user_name }}/.sudo_as_admin_successful
state: touch
access_time: preserve
modification_time: preserve
# no_log: true
# entfernt:
# To run a command as administrator (user "root"), use "sudo <command>".
# See "man sudo_root" for details.
# unter der motd, bevor man sich das erstmal mit sudo angemeldet hat
- name: create .selected_editor
become: yes
ansible.builtin.template:
src: ".selected_editor"
dest: "/home/{{ create_user_name }}/.selected_editor"
# no_log: true
# Validate the sudoers file before saving
- name: set sudo without password
become: yes
ansible.builtin.template:
src: sudoers
dest: /etc/sudoers.d/{{ create_user_name }}
validate: /usr/sbin/visudo -cf %s
# no_log: true