Skip to content

Commit

Permalink
Fix to make it possible to read file on a remote node
Browse files Browse the repository at this point in the history
  • Loading branch information
userlocalhost committed Apr 18, 2017
1 parent 651c692 commit 936e82c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
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: False
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
10 changes: 8 additions & 2 deletions roles/bwc/tasks/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
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
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

0 comments on commit 936e82c

Please sign in to comment.