blob: 69121fff634682afc83cdb1ff94727adf2b5bc56 [file] [log] [blame]
---
# tasks file for apigee-opdk-setup-mirror-nginx
- name: Install mirror server
shell: "{{ apigee_service }} apigee-mirror nginxconfig"
- name: Create mirror.properties
file:
path: '{{ mirror_file }}'
state: touch
owner: apigee
group: apigee
- name: Add line
lineinfile:
dest: '{{ mirror_file }}'
line: '{{ item }}'
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"