blob: 42d0600913f74cdf4398f1cb0161cdfde0eacfe8 [file] [log] [blame]
---
# tasks file for apigee-opdk-setup-local-repository-archive
#- name: Clean up any old repos
# become: true
# file:
# path: '{{ apigeerepobasepath }}/repos'
# state: absent
- name: Ensure repo folders exists
become: true
file:
path: '{{ apigeerepobasepath }}/repos'
state: directory
owner: "{{ opdk_user_name }}"
group: "{{ opdk_group_name }}"
- name: Ensure rsync is present
become: true
yum:
name: rsync
state: present
- block:
- name: Copy archive to target node
synchronize:
src: "{{ local_apigee_path }}/{{ apigee_archive_name }}"
dest: "{{ apigeerepobasepath }}/{{ apigee_archive_name }}"
rsync_opts: ['--partial-dir={{ opdk_installer_path }}']
register: results
failed_when: "'sudo: sorry, you must have a tty to run sudo' in results.stderr"
rescue:
- name: Update to include tty
lineinfile:
path: /etc/sudoers
backrefs: yes
backup: yes
regex: "^(Default).*(requiretty)"
line: "\1 ! \2"
state: present
- name: Copy archive to target node
synchronize:
src: "{{ local_apigee_path }}/{{ apigee_archive_name }}"
dest: "{{ apigeerepobasepath }}/{{ apigee_archive_name }}"
rsync_opts: ['--partial-dir={{ opdk_installer_path }}']
- name: Unarchive on target node
become: true
unarchive:
src: '{{ apigeerepobasepath }}/{{ apigee_archive_name }}'
dest: '{{ apigeerepobasepath }}'
copy: false
owner: "{{ opdk_user_name }}"
group: "{{ opdk_group_name }}"