ansible-role-nginx/tasks/opensource/install-alpine.yml

17 lines
710 B
YAML
Raw Normal View History

2020-09-15 21:27:06 +02:00
---
- name: (Alpine Linux) {{ (nginx_setup == 'uninstall') | ternary('Remove', 'Configure') }} NGINX repository
2020-09-15 21:27:06 +02:00
lineinfile:
path: /etc/apk/repositories
insertafter: EOF
line: "{{ nginx_repository | default(nginx_default_repository_alpine) }}"
state: "{{ (nginx_state == 'uninstall') | ternary('absent', 'present') }}"
when: nginx_manage_repo | bool
2020-09-15 21:27:06 +02:00
- name: (Alpine Linux) {{ nginx_setup | capitalize }} NGINX
2020-09-15 21:27:06 +02:00
apk:
name: "nginx{{ (nginx_repository is not defined and nginx_setup != 'uninstall') | ternary('@nginx', '') }}{{ nginx_version | default('') }}"
2020-09-15 21:27:06 +02:00
state: "{{ nginx_state }}"
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX