blob: d9fb0cb260dc041cf15137cdfe780021b508dde7 [file] [log] [blame]
---
# tasks file for apigee-opdk-setup-mirror-nginx
- name: Ensure that apigee-mirror is installed
shell: "{{ apigee_service }} apigee_mirror install"
args:
creates: "{{ apigee_home }}/apigee-mirror/lib/actions/nginxconfig"
- name: Install mirror server
shell: "{{ apigee_service }} apigee-mirror nginxconfig"
- block:
- name: Create mirror.properties
file:
path: '{{ mirror_file }}'
state: touch
owner: apigee
group: apigee
- name: Add line
lineinfile:
dest: '{{ mirror_file }}'
line: '{{ item }}'
owner: apigee
group: apigee
with_items:
- conf_apigee_mirror_listen_port={{ apigee_mirror_listen_port }}
- conf_apigee_mirror_server_name={{ apigee_mirror_server_name }}
#- name: Add nginx credentials
# lineinfile:
# backrefs: yes
# dest: /etc/environment
# regexp: "({{ item.attribute }}).*"
# line: '{{ item.attribute }}{{ item.value }}'
# with_items:
# - { attribute: 'export MIRROR_USERNAME=', value: '{{ apigee_repo_user | default(default_apigee_repo_user) }}' }
# - { attribute: 'export MIRROR_PASSWORD=', value: '{{ apigee_repo_password| default(default_apigee_repo_password) }}' }
- name: Nginx restart
shell: "{{ apigee_nginx }} restart"
become: yes