-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfull.yml
66 lines (59 loc) · 1.55 KB
/
full.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
66
---
- name: Prepare
hosts: all
gather_facts: false
become: true
become_method: su
tags: prepare
tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
changed_when: false
- name: Install sudo
apt:
name: sudo
state: present
- name: Add unprivileged user to sudo group
user:
name: "{{ unprivileged_user }}"
groups: sudo
append: true
- name: Copy SSH public key to the remote server
hosts: all
gather_facts: true
tags: ssh
tasks:
- name: Copy SSH public key to the remote server
authorized_key:
user: "{{ ansible_user_id }}"
state: present
key: "{{ lookup('file', ssh_pub_key) }}"
- name: Configure network interfaces
hosts: all
become: true
gather_facts: true
tags: interfaces
roles:
- role: ansible-role-interfaces
- name: Setup dropbear in initramfs
hosts: all
become: true
gather_facts: false
tags: dropbear
vars:
ssh_pub_key: "{{ dropbear.ssh_pub_key }}"
static_ip: "{{ dropbear.static_ip | default('') }}"
remote_ip: "{{ dropbear.remote_ip | default('') }}"
gateway: "{{ dropbear.gateway | default('') }}"
netmask: "{{ dropbear.netmask | default('') }}"
hostname: "{{ dropbear.hostname | default('') }}"
network_interface: "{{ dropbear.network_interface }}"
ssh_port: "{{ dropbear.ssh_port }}"
roles:
- role: dropbear_luks
- name: Deploy ddclient
hosts: all
become: true
tags: ddclient
roles:
- role: ddclient