-
Notifications
You must be signed in to change notification settings - Fork 0
/
set-up.yml
65 lines (57 loc) · 2.2 KB
/
set-up.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
- hosts: localhost
gather_facts: true
vars_prompt:
- name: to_be_stored_server_address
prompt: What is your server ip?
private: false
- name: to_be_stored_ssh_public_key_path
prompt: Where is your public ssh-key located?
private: false
- name: to_be_stored_server_user
prompt: What username would you like to have on the server?
private: false
- name: to_be_vaulted_server_root_password
prompt: What is the root password of the server?
private: false
- name: to_be_vaulted_domain_email
prompt: What is your email?
private: false
- name: to_be_vaulted_domain_name
prompt: What is your domain name?
private: false
- name: to_be_vaulted_syncthing_username
prompt: Type desired username for Syncthing-GUI
private: false
- name: to_be_vaulted_syncthing_password
prompt: Type desired password for Syncthing-GUI
private: false
- name: vault_password
prompt: Type password for encrypting vault-items
private: false
vars:
encrypted_server_root_password: "{{ to_be_vaulted_server_root_password | vault(vault_password, wrap_object=true) | to_yaml }}"
encrypted_domain_email: "{{ to_be_vaulted_domain_email | vault(vault_password, wrap_object=true) | to_yaml }}"
encrypted_domain_name: "{{ to_be_vaulted_domain_name | vault(vault_password, wrap_object=true) | to_yaml }}"
encrypted_syncthing_username: "{{ to_be_vaulted_syncthing_username | vault(vault_password, wrap_object=true) | to_yaml }}"
encrypted_syncthing_password: "{{ to_be_vaulted_syncthing_password | vault(vault_password, wrap_object=true) | to_yaml }}"
pip_install_packages:
- name: passlib
tasks:
- name: add host to ssh-config
ansible.builtin.blockinfile:
path: ~/.ssh/config
create: true
block: |
Host my_selfhosted_server
User {{ to_be_stored_server_user }}
HostName {{ to_be_stored_server_address }}
Port {{ security_ssh_port }}
- name: vault data
template:
src: ./group_vars/all/vault.yml.j2
dest: ./group_vars/all/vault.yml
roles:
- role: geerlingguy.pip
tags:
- pip