1
0
Fork 0
mirror of https://github.com/samsapti/bachelor-project.git synced 2024-11-22 21:07:54 +00:00
bachelor-project/ansible/playbook.yml

29 lines
757 B
YAML
Raw Normal View History

# vim: ft=yaml.ansible
---
2023-04-18 13:34:11 +00:00
- name: Provision MPC players
hosts: all
gather_facts: true
become: true
tasks:
- name: Create user {{ username }}
ansible.builtin.user:
name: "{{ username }}"
2023-04-18 13:34:11 +00:00
password: "{{ secrets.user_password | ansible.builtin.password_hash('sha512') }}"
2023-04-18 22:56:27 +00:00
shell: /bin/bash
groups:
- sudo
2023-04-18 22:56:27 +00:00
update_password: on_create
state: present
- name: Add public SSH key to user {{ username }}
ansible.posix.authorized_key:
user: "{{ username }}"
2023-04-18 13:38:01 +00:00
key: "{{ ssh_keys | join('\n') }}"
exclusive: true
2023-04-18 13:38:01 +00:00
state: present
2023-04-18 13:34:11 +00:00
- name: Import role mp_spdz
ansible.builtin.import_role:
name: mp_spdz
become_user: "{{ username }}"