-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09faba6
commit 157e16f
Showing
5 changed files
with
239 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
namespace: nephelaiio | ||
name: mongodb | ||
version: 0.0.16 | ||
version: 0.0.17 | ||
readme: README.md | ||
authors: | ||
- Ted Cook <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
options: | ||
role-file: requirements.yml | ||
requirements-file: requirements.yml | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: mongodb-stop-mongos01 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_mongos | ||
- mongodb | ||
- name: mongodb-stop-mongos02 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_mongos | ||
- mongodb | ||
- name: mongodb-stop-config01 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_config | ||
- mongodb | ||
- name: mongodb-stop-config02 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_config | ||
- mongodb | ||
- name: mongodb-stop-config03 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_config | ||
- mongodb | ||
- name: mongodb-stop-shard01 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_shard1 | ||
- mongodb | ||
- name: mongodb-stop-shard02 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_shard1 | ||
- mongodb | ||
- name: mongodb-stop-shard03 | ||
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
tmpfs: | ||
- /tmp | ||
- /opt | ||
groups: | ||
- mongodb_shard1 | ||
- mongodb | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
prepare: ../common/prepare.yml | ||
converge: ../common/install.yml | ||
side_effect: ../common/restart.yml | ||
verify: ../common/verify.yml | ||
config_options: | ||
defaults: | ||
callbacks_enabled: ansible.posix.profile_tasks | ||
verifier: | ||
name: ansible | ||
scenario: | ||
test_sequence: | ||
- dependency | ||
- cleanup | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- idempotence | ||
- side_effect | ||
- verify | ||
- cleanup | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
- name: Update config nodes | ||
serial: 1 | ||
hosts: "{{ mongodb_config | default('mongodb_config') }}" | ||
become: true | ||
roles: | ||
- nephelaiio.mongodb.update | ||
vars: | ||
update_reboot: false | ||
update_cache_valid_time: 1 | ||
pre_tasks: | ||
- name: Include collection variables | ||
ansible.builtin.include_vars: | ||
file: main.yml | ||
tasks: | ||
- name: Include mongos service tasks | ||
ansible.builtin.include_role: | ||
name: nephelaiio.mongodb.mongodb | ||
tasks_from: service | ||
|
||
- name: Reboot node | ||
ansible.builtin.reboot: | ||
|
||
- name: Wait for replica set to stabilize | ||
community.mongodb.mongodb_status: | ||
replica_set: "{{ mongos_replicaset_config_name | default('config') }}" | ||
validate: minimal | ||
poll: "{{ mongodb_reconfig_poll }}" | ||
interval: "{{ mongodb_reconfig_interval }}" | ||
|
||
|
||
- name: Update shard1 nodes | ||
serial: 1 | ||
hosts: "{{ mongodb_shard1 | default('mongodb_shard1') }}" | ||
become: true | ||
roles: | ||
- nephelaiio.mongodb.update | ||
vars: | ||
update_reboot: false | ||
update_cache_valid_time: 1 | ||
pre_tasks: | ||
- name: Include collection variables | ||
ansible.builtin.include_vars: | ||
file: main.yml | ||
tasks: | ||
- name: Include mongos service tasks | ||
ansible.builtin.include_role: | ||
name: nephelaiio.mongodb.mongodb | ||
tasks_from: service | ||
|
||
- name: Reboot node | ||
ansible.builtin.reboot: | ||
|
||
- name: Wait for replica set to stabilize | ||
community.mongodb.mongodb_status: | ||
replica_set: "{{ mongos_replicaset_config_name | default('config') }}" | ||
validate: minimal | ||
poll: "{{ mongodb_reconfig_poll }}" | ||
interval: "{{ mongodb_reconfig_interval }}" | ||
|
||
|
||
- name: Update mongos nodes | ||
hosts: "{{ mongodb_mongos | default('mongodb_mongos') }}" | ||
become: true | ||
serial: 1 | ||
roles: | ||
- nephelaiio.mongodb.update | ||
vars: | ||
update_reboot: false | ||
update_cache_valid_time: 1 | ||
pre_tasks: | ||
- name: Include collection variables | ||
ansible.builtin.include_vars: | ||
file: main.yml | ||
tasks: | ||
- name: Include mongos service tasks | ||
ansible.builtin.include_role: | ||
name: nephelaiio.mongodb.mongos | ||
tasks_from: service | ||
|
||
- name: Reboot node | ||
ansible.builtin.reboot: | ||
|
||
- name: Check mongos cluster status | ||
community.mongodb.mongodb_shell: | ||
login_database: "admin" | ||
eval: "sh.status()" | ||
retries: "{{ mongodb_reconfig_poll }}" | ||
delay: "{{ mongodb_reconfig_interval }}" | ||
changed_when: false |