Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to make it possible to read file on a remote node #138

Merged
merged 3 commits into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions roles/bwc/tasks/bwc_repos_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@
Content-Type: "application/x-www-form-urlencoded"
body: "name={{ ansible_nodename }}"

- name: Set bwc_read_token variable
- name: Read bwc_read_token from file
become: yes
no_log: yes
changed_when: no
command: cat "/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt"
register: _bwc_read_token

- name: Set bwc_read_token variable
no_log: yes
set_fact:
bwc_read_token: "{{ lookup('file', '/etc/packagecloud/StackStorm_{{ bwc_repo }}_read_token.txt') }}"
bwc_read_token: "{{ _bwc_read_token.stdout }}"

- name: Add BWC enterprise repos on {{ ansible_distribution }}
include: bwc_repos_{{ ansible_pkg_mgr }}.yml
Expand Down
11 changes: 9 additions & 2 deletions roles/bwc/tasks/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
path: /etc/packagecloud/bwc_license_hash.txt
register: bwc_license_hash_file

- name: Read bwc_license_hash from file if it exits
- name: Read bwc_license_hash_file if it exits
command: cat /etc/packagecloud/bwc_license_hash.txt
register: _bwc_license_hash
no_log: yes
changed_when: no
when: bwc_license_hash_file.stat.exists

- name: Set bwc_license_hash from file context
set_fact:
bwc_license_hash: "{{ lookup('file', '/etc/packagecloud/bwc_license_hash.txt') }}"
bwc_license_hash: "{{ _bwc_license_hash.stdout }}"
no_log: yes
when: bwc_license_hash_file.stat.exists

Expand Down