File tree Expand file tree Collapse file tree 7 files changed +73
-3
lines changed Expand file tree Collapse file tree 7 files changed +73
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ modules:
49
49
amplify_enable : false
50
50
amplify_key : null
51
51
52
+ # Install NGINX Controller.
53
+ # Use your NGINX Controller API key.
54
+ # Default is null.
55
+ controller_enable : false
56
+ controller_license : null
57
+ controller_api_url : null
58
+
52
59
# Enable NGINX status data.
53
60
# Will enable 'stub_status' in NGINX Open Source and 'status' in NGINX Plus.
54
61
# Default is false.
Original file line number Diff line number Diff line change 21
21
name : unitd
22
22
state : started
23
23
enabled : yes
24
+
25
+ - name : " (Handler: All OSs) Start NGINX Controller Agent"
26
+ service :
27
+ name : controller-agent
28
+ state : started
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ galaxy_info:
35
35
galaxy_tags :
36
36
- nginx
37
37
- amplify
38
+ - controller
38
39
- oss
39
40
- plus
40
41
- web
Original file line number Diff line number Diff line change
1
+ ---
2
+ - import_tasks : setup-debian.yml
3
+ when : ansible_os_family == "Debian"
4
+
5
+ - import_tasks : setup-redhat.yml
6
+ when : ansible_os_family == "RedHat"
7
+
8
+ - name : " (Install: All OSs) Install NGINX Controller Agent"
9
+ package :
10
+ name : nginx-controller-agent
11
+ state : present
12
+
13
+ - name : " (Setup: All OSs) Copy NGINX Controller Agent Configuration Template"
14
+ copy :
15
+ remote_src : yes
16
+ src : /etc/controller-agent/agent.controller.conf.default
17
+ dest : /etc/controller-agent/agent.conf
18
+
19
+ - name : " (Setup: All OSs) Copy NGINX Configurator Agent Configuration Template"
20
+ copy :
21
+ remote_src : yes
22
+ src : /etc/controller-agent/agent.configurator.conf.default
23
+ dest : /etc/controller-agent/agent.configurator.conf
24
+
25
+ - name : " (Setup: All OSs) Configure NGINX Controller Agent API Key"
26
+ lineinfile :
27
+ dest : /etc/controller-agent/agent.conf
28
+ regexp : api_key =.*
29
+ line : " api_key = {{ controller_license }}"
30
+
31
+ - name : " (Setup: All OSs) Configure NGINX Controller Agent API URL"
32
+ lineinfile :
33
+ dest : /etc/controller-agent/agent.conf
34
+ regexp : api_url =.*
35
+ line : " api_url = {{ controller_api_url }}"
36
+
37
+ - name : " (Setup: All OSs) Configure NGINX Controller Agent API Hostname"
38
+ lineinfile :
39
+ dest : /etc/controller-agent/agent.conf
40
+ regexp : hostname =.*
41
+ line : " hostname = {{ ansible_hostname }}"
42
+ notify : " (Handler: All OSs) Start NGINX Controller Agent"
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : " (Install: Debian/Ubuntu) Add NGINX Controller Repository"
3
+ apt_repository :
4
+ filename : nginx-controller
5
+ repo : deb http://packages.nginx.org/controller/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} controller
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : " (Install: CentOS/RedHat) Add NGINX Controller Agent Repository"
3
+ yum_repository :
4
+ name : nginx-controller
5
+ baseurl : http://packages.nginx.org/controller/centos/$releasever/$basearch/
6
+ description : NGINX Controller Agent
7
+ gpgcheck : yes
Original file line number Diff line number Diff line change 31
31
- import_tasks : conf/setup-rest-api.yml
32
32
when : rest_api_enable and type == "plus"
33
33
34
- - import_tasks : amplify/install-amplify.yml
35
- when : amplify_enable and amplify_key is defined and amplify_key
36
-
37
34
when : nginx_enable
38
35
36
+ - import_tasks : amplify/install-amplify.yml
37
+ when : amplify_enable and amplify_key is defined and amplify_key
38
+
39
+ - import_tasks : controller/install-controller.yml
40
+ when : controller_enable and controller_license is defined and controller_license and controller_api_url is defined and controller_api_url
41
+
39
42
- import_tasks : unit/install-unit.yml
40
43
when : unit_enable
You can’t perform that action at this time.
0 commit comments