-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidena_shared.yaml
50 lines (46 loc) · 1.4 KB
/
idena_shared.yaml
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
---
- name: Get my public IP
hosts: main
become: yes
tasks:
- name: Get my public IP
community.general.ipify_facts:
- name: Install net-tools package
ansible.builtin.apt:
name: net-tools
update_cache: yes
- name: Get local IP address
ansible.builtin.shell:
cmd: "ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}'"
register: ip_droplet_address_full
- name: Save IP address only to ip_droplet_address
ansible.builtin.set_fact:
ip_droplet_address: "{{ ip_droplet_address_full.stdout_lines | first }}"
- name: Idena Deployment
hosts: main
become: yes
roles:
- install_required_packages
- disable_ssh_password
- security_preparations
- idena_user_add
- idena_user_home
- idena_daemon_add
- ufw_rules
- system_limits
- role: install_nodejs
tags: [nodejs_inst]
- role: install_idena_proxy
tags: [idenaproxy_inst]
become: true
become_user: "{{ username }}"
- role: idenaproxy_daemon_add
tags: [iproxy_as_service]
- role: install_haproxy_letsencrypt
tags: [haproxy_inst_letsencrypt]
vars:
current_domain_ip: "{{ lookup('community.general.dig', droplet_domain) }}"
when: current_domain_ip == ipify_public_ip and letsencrypt|bool == True
- role: install_haproxy
tags: [haproxy_inst]
when: letsencrypt|bool == False