Skip to content

Commit

Permalink
Add cluster online playbook (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Nov 9, 2023
1 parent 2770a24 commit 53b0e23
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 1 deletion.
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.0.8
version: 0.0.9
readme: README.md
authors:
- Ted Cook <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions molecule/common/online.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Import online playbook
import_playbook: nephelaiio.mongodb.online
File renamed without changes.
1 change: 1 addition & 0 deletions molecule/install/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ provisioner:
prepare: ../common/prepare.yml
converge: ../common/install.yml
side-effect: ../common/install.yml
verify: ../common/verify.yml
config_options:
defaults:
callbacks_enabled: ansible.posix.profile_tasks
Expand Down
145 changes: 145 additions & 0 deletions molecule/online/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
driver:
name: docker
platforms:
- name: 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: 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: 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: 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: 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: 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: 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: 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:
converge: ../common/offline.yml
side_effect: ../common/online.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
6 changes: 6 additions & 0 deletions molecule/online/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Include shared prepare play
ansible.builtin.import_playbook: ../common/prepare.yml

- name: Include shared install play
ansible.builtin.import_playbook: ../common/install.yml
11 changes: 11 additions & 0 deletions playbooks/online.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Start mongos services
hosts: "{{ mongodb_mongos | default('mongodb_mongos') }}"
become: true
tasks:
- name: Include mongos service tasks
ansible.builtin.include_role:
name: nephelaiio.mongodb.mongos
tasks_from: service
vars:
mongos_service_state: started

0 comments on commit 53b0e23

Please sign in to comment.