develop #1
39
test.yml
39
test.yml
@@ -3,16 +3,16 @@
|
||||
tasks:
|
||||
- name: Create default user
|
||||
user:
|
||||
name: "{{ default_user }}"
|
||||
password: "{{ default_user_password | password_hash('sha512') }}"
|
||||
groups: sudo
|
||||
create_home: yes
|
||||
shell: /bin/zsh
|
||||
generate_ssh_key: yes
|
||||
ssh_key_bits: 2048
|
||||
ssh_key_file: .ssh/id_rsa
|
||||
update_password: always
|
||||
state: present
|
||||
name: "{{ default_user }}"
|
||||
password: "{{ default_user_password | password_hash('sha512') }}"
|
||||
groups: sudo
|
||||
create_home: yes
|
||||
shell: /bin/zsh
|
||||
generate_ssh_key: yes
|
||||
ssh_key_bits: 2048
|
||||
ssh_key_file: .ssh/id_rsa
|
||||
update_password: always
|
||||
state: present
|
||||
|
||||
- name: Ensure sudo group has passwordless sudo privileges
|
||||
lineinfile:
|
||||
@@ -30,4 +30,21 @@
|
||||
- name: Install apt packages
|
||||
apt:
|
||||
name: "{{ packages_to_install }}"
|
||||
...
|
||||
|
||||
- name: Get default user home
|
||||
getent:
|
||||
database: passwd
|
||||
key: "{{ default_user }}"
|
||||
split: ":"
|
||||
|
||||
- name: Set default user home
|
||||
set_fact:
|
||||
default_user_home: "{{ getent_passwd[default_user][4] }}"
|
||||
|
||||
- name: Install Rustup
|
||||
shell: curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.cargo/bin/rustup"
|
||||
environment:
|
||||
RUSTUP_HOME: "{{ default_user_home }}/.rustup"
|
||||
CARGO_HOME: "{{ default_user_home }}/.cargo"
|
||||
|
||||
Reference in New Issue
Block a user