a7d3164ba1
* Remove syntax error When evaluated (i.e. when nginx_amplify_enable=true and nginx_amplify_api_key is defined) this line causes a syntax error To check for empty string, opted for temporary solution outlined in https://github.com/ansible/ansible-lint/issues/457 * Fix reference to amplify api key Previously was labelled `amplify_api_key`. Changed to `nginx_amplify_api_key` in #a55a50d * Fix reference to default config file On my system at least (bionic), the default configuration file is `/etc/amplify-agent/agent.conf.default` This is also assumed be to the case on the amplify install shell script https://github.com/nginxinc/nginx-amplify-agent/blob/master/packages/install.sh#L526
25 lines
712 B
YAML
25 lines
712 B
YAML
---
|
|
- import_tasks: setup-debian.yml
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- import_tasks: setup-redhat.yml
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
- name: "(Install: All OSs) Install NGINX Amplify Agent"
|
|
package:
|
|
name: nginx-amplify-agent
|
|
state: present
|
|
|
|
- name: "(Setup: All OSs) Copy NGINX Configurator Agent Configuration Template"
|
|
copy:
|
|
remote_src: yes
|
|
src: /etc/amplify-agent/agent.conf.default
|
|
dest: /etc/amplify-agent/agent.conf
|
|
|
|
- name: "(Setup: All OSs) Configure NGINX Amplify Agent API Key"
|
|
lineinfile:
|
|
dest: /etc/amplify-agent/agent.conf
|
|
regexp: api_key =.*
|
|
line: "api_key = {{ nginx_amplify_api_key }}"
|
|
notify: "(Handler: All OSs) Start NGINX Amplify Agent"
|