Skip to content

Commit

Permalink
fix ova flag implementation round 3
Browse files Browse the repository at this point in the history
  • Loading branch information
padthaitofuhot committed Sep 25, 2017
1 parent de81dc8 commit e872053
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ui/ansible/roles/CentOS_7_baseline_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
creates: "{{host_cache_dir}}/disable_package_cache.sem"
when:
- not ( num_data_nodes|int == 1 and top_data_node == install_node )
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

# TODO: Improve this
# This is suuuuuper hacky - There should be a better way using the yum module,
Expand All @@ -45,8 +45,8 @@
args:
creates: "{{host_cache_dir}}/disable_package_cache.sem"
when:
- not ( num_data_nodes|int == 1 and top_data_node == install_node and ansible_local.ova is defined )
- ansible_local.ova is not defined
- not ( num_data_nodes|int == 1 and top_data_node == install_node and ( ansible_local is defined and ansible_local.ova is defined ) )
- ( ansible_local is defined and ansible_local.ova is not defined )

- name: CentOS 7 | Configure ntp
template: src=ntp.conf.j2 dest=/etc/ntp.conf
Expand Down
10 changes: 5 additions & 5 deletions ui/ansible/roles/CentOS_7_reboot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ignore_errors: True
failed_when: False
changed_when: False
when: ansible_local.ova is not defined
when: ( ansible_local is defined and ansible_local.ova is not defined )

## 776 : /sbin/dhclient
#- name: "Debug the needs_restarting output"
Expand All @@ -17,7 +17,7 @@
msg: "Node flagged for reboot by package manager"
when:
- ( needs_restarting|failed ) and flag_install_node is not defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

- name: CentOS 7 | Check if install node also needs restarting
debug:
Expand All @@ -26,7 +26,7 @@
- CentOS 7 | Reboot required
when:
- ( needs_restarting|failed ) and flag_install_node is defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

- name: CentOS 7 | Reboot node(s)
become: True
Expand All @@ -36,14 +36,14 @@
ignore_errors: True
when:
- ( needs_restarting|failed ) and flag_install_node is not defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

- name: CentOS 7 | Wait for node(s) to reboot
become: False
local_action: wait_for host="{{ ansible_host | default(inventory_hostname) }}" port="{{ ansible_port }}" state=started delay=15 timeout=300
when:
- ( needs_restarting|failed ) and flag_install_node is not defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

# host={{ ansible_default_ipv4.address }} port=22 state=started delay=60 timeout=120

Expand Down
2 changes: 1 addition & 1 deletion ui/ansible/roles/common_baseline_install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
when:
- flag_install_node is not defined
- not ( num_data_nodes|int == 1 and top_data_node == install_node )
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

- name: Common | Update block storage path permissions
file:
Expand Down
4 changes: 2 additions & 2 deletions ui/ansible/roles/common_sync_caches_by_torrent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
force: yes
when:
- flag_install_node is not defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )
#creates: "{{host_cache_dir}}/disable_package_cache.sem"

- name: Common | Torrent sync caches with nodes
Expand All @@ -43,4 +43,4 @@
creates: "{{host_cache_dir}}/disable_package_cache.sem"
when:
- flag_install_node is not defined
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )
6 changes: 3 additions & 3 deletions ui/ansible/roles/installer_build_cache/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
with_items: "{{ caches.keys() }}"
when:
- not ( num_data_nodes|int == 1 and top_data_node == install_node )
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )
loop_control:
label: "{{ cache_dir }}/{{ item }}"

Expand All @@ -19,7 +19,7 @@
register: cacheresults
when:
- not ( num_data_nodes|int == 1 and top_data_node == install_node )
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )
loop_control:
label: "{{ host_cache_dir }}/{{ item.key }}/{{ item.value.dest }}"

Expand All @@ -29,4 +29,4 @@
creates: "{{ cache_dir }}/cache.torrent"
when:
- not ( num_data_nodes|int == 1 and top_data_node == install_node )
- ansible_local.ova is not defined
- ( ansible_local is defined and ansible_local.ova is not defined )

0 comments on commit e872053

Please sign in to comment.