Skip to content

Commit

Permalink
Parameterize update skip group (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Mar 13, 2024
1 parent 6580c03 commit 2ed963f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: nephelaiio
name: mongodb
version: 0.2.18
version: 0.2.19
readme: README.md
authors:
- Ted Cook <[email protected]>
Expand Down
18 changes: 12 additions & 6 deletions playbooks/update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Update config nodes
serial: 1
hosts: "{{ __mongodb_config }}:!mongodb_update_skip"
hosts: "{{ __mongodb_config }}:!{{ mongodb_update_skip_group | default('mongodb_update_skip') }}"
become: true
vars_files:
- main.yml
Expand All @@ -27,14 +27,16 @@
virtualenv: "{{ _virtualenv_tmpdir.path }}/venv"
changed_when: false

- name: Restart Mongos services
- name: Stop Mongos services
vars:
ansible_python_interpreter: "{{ _virtualenv_tmpdir.path }}/venv/bin/python"
block:
- name: Include Mongos service tasks
ansible.builtin.include_role:
name: nephelaiio.mongodb.mongodb
tasks_from: service
vars:
mongodb_service_state: stopped

- name: Reboot node
ansible.builtin.reboot:
Expand All @@ -56,7 +58,7 @@

- name: Update shard1 nodes
serial: 1
hosts: "{{ __mongodb_shard1 }}:!mongodb_update_skip"
hosts: "{{ __mongodb_shard1 }}:!{{ mongodb_update_skip_group | default('mongodb_update_skip') }}"
become: true
vars_files:
- main.yml
Expand All @@ -82,14 +84,16 @@
virtualenv: "{{ _virtualenv_tmpdir.path }}/venv"
changed_when: false

- name: Restart Mongos services
- name: Stop Mongos services
vars:
ansible_python_interpreter: "{{ _virtualenv_tmpdir.path }}/venv/bin/python"
block:
- name: Include Mongos service tasks
ansible.builtin.include_role:
name: nephelaiio.mongodb.mongodb
tasks_from: service
vars:
mongodb_service_state: stopped

- name: Reboot node
ansible.builtin.reboot:
Expand All @@ -110,7 +114,7 @@


- name: Update Mongos nodes
hosts: "{{ __mongodb_mongos }}:!mongodb_update_skip"
hosts: "{{ __mongodb_mongos }}:!{{ mongodb_update_skip_group | default('mongodb_update_skip') }}"
become: true
serial: 1
vars_files:
Expand All @@ -137,14 +141,16 @@
virtualenv: "{{ _virtualenv_tmpdir.path }}/venv"
changed_when: false

- name: Restart Mongos services
- name: Stop Mongos services
vars:
ansible_python_interpreter: "{{ _virtualenv_tmpdir.path }}/venv/bin/python"
block:
- name: Include Mongos service tasks
ansible.builtin.include_role:
name: nephelaiio.mongodb.mongos
tasks_from: service
vars:
mongodb_service_state: stopped

- name: Reboot node
ansible.builtin.reboot:
Expand Down
2 changes: 1 addition & 1 deletion roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ roles:
scm: git
- name: mongodb
src: https://github.com/wpnops/ansible-role-mongodb.git
version: 0.1.29
version: 0.1.30
scm: git
- name: update
src: https://github.com/robertdebock/ansible-role-update.git
Expand Down

0 comments on commit 2ed963f

Please sign in to comment.