-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
install.yml
96 lines (86 loc) · 1.96 KB
/
install.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
- name: Install packages to create the Access Point
apt:
name:
- util-linux
- procps
- hostapd
- iproute2
- iw
- dnsmasq
- iptables
update_cache: yes
cache_valid_time: 3600
state: present
notify: Start create_ap
- name: populate service facts
service_facts:
- name: Stop service
service:
name: create_ap
state: stopped
when: "'create_ap' in services"
notify: Restart create_ap
- name: Install create_ap script
copy:
src: create_ap
dest: /usr/bin/create_ap
owner: root
group: root
mode: 0755
notify: Start create_ap
- name: Create service configuration directory
file:
path: /etc/create_ap
state: directory
owner: root
group: root
mode: 0755
notify: Start create_ap
- name: Add access point configuration
template:
src: create_ap.conf.j2
dest: "{{ create_ap_config }}"
owner: root
group: root
mode: 0644
notify: Restart create_ap
- name: Update localhost name
lineinfile:
path: /etc/hosts
regexp: ^127\.0\.1\.1
state: present
line: 127.0.0.1 {{ ansible_hostname }}
owner: root
group: root
mode: "0644"
- name: Redirect traffic for The Combine to the AP gateway
lineinfile:
path: /etc/hosts
regexp: ^{{ ap_gateway }}
state: present
line: "{{ ap_gateway }} {{ ap_hostname }}.{{ ap_domain }} {{ ap_hostname }} rancher.{{ ap_domain }}"
- name: Install hosts lists for access point
template:
src: create_ap.hosts.j2
dest: "{{ ap_hosts_config }}"
owner: root
group: root
mode: 0644
notify: Restart create_ap
- name: Create service directory
file:
path: /usr/lib/systemd/system
state: directory
owner: root
group: root
mode: 0755
notify: Start create_ap
- name: Setup create_ap service files
template:
src: create_ap.service.j2
dest: /usr/lib/systemd/system/create_ap.service
owner: root
group: root
mode: 0644
notify: Start create_ap