Amplify installation fixes (#113)

* 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
This commit is contained in:
Christopher Blanchard 2019-04-08 15:27:36 +02:00 committed by Grzegorz Dzien
parent e658031360
commit a7d3164ba1
2 changed files with 4 additions and 4 deletions

View File

@ -13,12 +13,12 @@
- name: "(Setup: All OSs) Copy NGINX Configurator Agent Configuration Template" - name: "(Setup: All OSs) Copy NGINX Configurator Agent Configuration Template"
copy: copy:
remote_src: yes remote_src: yes
src: /etc/amplify-agent/agent.configurator.conf.default src: /etc/amplify-agent/agent.conf.default
dest: /etc/amplify-agent/agent.configurator.conf dest: /etc/amplify-agent/agent.conf
- name: "(Setup: All OSs) Configure NGINX Amplify Agent API Key" - name: "(Setup: All OSs) Configure NGINX Amplify Agent API Key"
lineinfile: lineinfile:
dest: /etc/amplify-agent/agent.conf dest: /etc/amplify-agent/agent.conf
regexp: api_key =.* regexp: api_key =.*
line: "api_key = {{ amplify_api_key }}" line: "api_key = {{ nginx_amplify_api_key }}"
notify: "(Handler: All OSs) Start NGINX Amplify Agent" notify: "(Handler: All OSs) Start NGINX Amplify Agent"

View File

@ -58,7 +58,7 @@
when: when:
- nginx_amplify_enable - nginx_amplify_enable
- nginx_amplify_api_key is defined - nginx_amplify_api_key is defined
- nginx_amplify_api_key - nginx_amplify_api_key | length > 0
- import_tasks: controller/install-controller.yml - import_tasks: controller/install-controller.yml
when: when: