diff --git a/galaxy.yml b/galaxy.yml index a71387e..eac6ece 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: nephelaiio name: mongodb -version: 0.0.8 +version: 0.0.9 readme: README.md authors: - Ted Cook diff --git a/molecule/common/online.yml b/molecule/common/online.yml new file mode 100644 index 0000000..e26bdf0 --- /dev/null +++ b/molecule/common/online.yml @@ -0,0 +1,3 @@ +--- +- name: Import online playbook + import_playbook: nephelaiio.mongodb.online diff --git a/molecule/install/verify.yml b/molecule/common/verify.yml similarity index 100% rename from molecule/install/verify.yml rename to molecule/common/verify.yml diff --git a/molecule/install/molecule.yml b/molecule/install/molecule.yml index 88c0808..dff0fc3 100644 --- a/molecule/install/molecule.yml +++ b/molecule/install/molecule.yml @@ -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 diff --git a/molecule/online/molecule.yml b/molecule/online/molecule.yml new file mode 100644 index 0000000..40a063e --- /dev/null +++ b/molecule/online/molecule.yml @@ -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 diff --git a/molecule/online/prepare.yml b/molecule/online/prepare.yml new file mode 100644 index 0000000..67b4f52 --- /dev/null +++ b/molecule/online/prepare.yml @@ -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 diff --git a/playbooks/online.yml b/playbooks/online.yml new file mode 100644 index 0000000..661dc7d --- /dev/null +++ b/playbooks/online.yml @@ -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