ansible-role-nginx/tasks/opensource/setup-alpine.yml
Alessandro Fael Garcia f6c48c12d6
Add Alpine tests to all molecule scenarios (#191)
* Use distro specific Ansible modules to install NGINX

* Install NGINX directly in Alpine distributions from the official repository to avoid naming conflicts

* Set travis_wait parameter to max timeout setting
2019-11-24 02:10:55 +01:00

29 lines
889 B
YAML

---
- name: "(Install: Alpine) Set Default APK NGINX Repository"
set_fact:
default_repository: >-
https://nginx.org/packages/{{ (nginx_branch == 'mainline')
| ternary('mainline/', '') }}alpine/v{{ ansible_distribution_version.split('.')[0] }}.{{ ansible_distribution_version.split('.')[1] }}/main
- name: "(Install: Alpine) Set APK NGINX Repository"
set_fact:
repository: "{{ nginx_repository | default(default_repository) }}"
- name: "(Install: Alpine) Add NGINX Repository"
lineinfile:
path: /etc/apk/repositories
insertafter: EOF
line: "{{ repository }}"
- name: "(Install: Alpine) Install Required Alpine Dependencies"
apk:
name:
- openssl
- pcre
- name: "(Install: Alpine) Install NGINX"
apk:
name: "nginx{{ nginx_version | default('') }}"
repository: "{{ repository }}"
notify: "(Handler: All OSs) Start NGINX"