Skip to content

Commit

Permalink
Update mongodb role release (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Nov 23, 2023
1 parent 5c9c1b2 commit 3988c87
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 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.1.0
version: 0.1.1
readme: README.md
authors:
- Ted Cook <[email protected]>
Expand Down
18 changes: 9 additions & 9 deletions molecule/upgrade/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@
- name: Query Debian package versions
ansible.builtin.shell:
cmd: "apt-cache madison {{ item }} | awk -F'|' '{ print $2 }'"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
register: _debian_package_query
when: ansible_os_family == "Debian"
changed_when: false

- name: Query RedHat package versions
ansible.builtin.shell:
cmd: "yum list {{ item }} --showduplicates | grep '^{{ item }}' | awk '{ print $1,$2 }' | sort -r"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
register: _redhat_package_query
when: ansible_os_family == "RedHat"
changed_when: false

- name: Set package version facts
ansible.builtin.set_fact:
_mongos_package_list: "{{ mongos_package_name }}"
_mongos_package_list: "{{ mongos_packages }}"
_mongos_package_query: "{{ _redhat_packages + _debian_packages }}"
vars:
_redhat_packages: "{{ [] if _redhat_package_query.skipped else _redhat_package_query.results }}"
Expand All @@ -117,11 +117,11 @@

- name: Initialize package versions
ansible.builtin.set_fact:
mongos_package_name: []
mongos_packages: []

- name: Set target Debian package versions
ansible.builtin.set_fact:
mongos_package_name: "{{ mongos_package_name + [_package] }}"
mongos_packages: "{{ mongos_packages + [_package] }}"
vars:
_stdout: "{{ item.stdout_lines }}"
_multiple: "{{ _stdout | length > 1 }}"
Expand All @@ -134,7 +134,7 @@

- name: Set target RedHat package versions
ansible.builtin.set_fact:
mongos_package_name: "{{ mongos_package_name + [_package] }}"
mongos_packages: "{{ mongos_packages + [_package] }}"
vars:
_stdout: "{{ item.stdout_lines }}"
_multiple: "{{ _stdout | length > 1 }}"
Expand All @@ -150,7 +150,7 @@

- name: Debug target package versions
ansible.builtin.debug:
var: mongos_package_name
var: mongos_packages
run_once: true


Expand Down Expand Up @@ -206,7 +206,7 @@
_package: "{{ item.split('=') | first }}"
_version: "{{ item.split('=') | last }}"
_installed: "{{ (packages[_package] | default([{'version': 'None'}]))[0].version }}"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
when:
- ansible_os_family == "Debian"
- _package not in packages or _version != _installed
Expand All @@ -220,7 +220,7 @@
_package: "{{ item.0 }}"
_version: "{{ item.1 | regex_replace(_prefix, '') | regex_replace(_suffix, '') }}"
_installed: "{{ (packages[_package] | default([{'version': 'None'}]))[0].version }}"
loop: "{{ _mongos_package_list | zip(mongos_package_name) }}"
loop: "{{ _mongos_package_list | zip(mongos_packages) }}"
when:
- ansible_os_family == "RedHat"
- _package not in packages or _version != _installed
2 changes: 1 addition & 1 deletion molecule/upgrade/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ provisioner:
- ufw
- mongodb-org
- mongodb-mongosh
mongos_package_name:
mongos_packages:
- mongodb-org-server
- mongodb-org-mongos
- mongodb-mongosh
Expand Down
18 changes: 9 additions & 9 deletions molecule/upgrade/side_effect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@
- name: Query Debian package versions
ansible.builtin.shell:
cmd: "apt-cache madison {{ item }} | awk -F'|' '{ print $2 }'"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
register: _debian_package_query
when: ansible_os_family == "Debian"
changed_when: false

- name: Query RedHat package versions
ansible.builtin.shell:
cmd: "yum list {{ item }} --showduplicates | grep '^{{ item }}' | awk '{ print $1,$2 }' | sort -r"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
register: _redhat_package_query
when: ansible_os_family == "RedHat"
changed_when: false

- name: Set package version facts
ansible.builtin.set_fact:
_mongos_package_list: "{{ mongos_package_name }}"
_mongos_package_list: "{{ mongos_packages }}"
_mongos_package_query: "{{ _redhat_packages + _debian_packages }}"
vars:
_redhat_packages: "{{ [] if _redhat_package_query.skipped else _redhat_package_query.results }}"
Expand All @@ -112,11 +112,11 @@

- name: Initialize package versions
ansible.builtin.set_fact:
mongos_package_name: []
mongos_packages: []

- name: Set target Debian package versions
ansible.builtin.set_fact:
mongos_package_name: "{{ mongos_package_name + [_package] }}"
mongos_packages: "{{ mongos_packages + [_package] }}"
vars:
_package: "{{ item.item }}={{ item.stdout_lines[0] | trim }}"
loop_control:
Expand All @@ -126,7 +126,7 @@

- name: Set target RedHat package versions
ansible.builtin.set_fact:
mongos_package_name: "{{ mongos_package_name + [_package] }}"
mongos_packages: "{{ mongos_packages + [_package] }}"
vars:
_target: "{{ item.stdout_lines[0] }}"
_arch: "{{ _target[0].split('.')[1] }}"
Expand All @@ -140,7 +140,7 @@

- name: Debug target package versions
ansible.builtin.debug:
var: mongos_package_name
var: mongos_packages
run_once: true


Expand Down Expand Up @@ -196,7 +196,7 @@
_package: "{{ item.split('=') | first }}"
_version: "{{ item.split('=') | last }}"
_installed: "{{ (packages[_package] | default([{'version': 'None'}]))[0].version }}"
loop: "{{ mongos_package_name }}"
loop: "{{ mongos_packages }}"
when:
- ansible_os_family == "Debian"
- _package not in packages or _version != _installed
Expand All @@ -210,7 +210,7 @@
_package: "{{ item.0 }}"
_version: "{{ item.1 | regex_replace(_prefix, '') | regex_replace(_suffix, '') }}"
_installed: "{{ (packages[_package] | default([{'version': 'None'}]))[0].version }}"
loop: "{{ _mongos_package_list | zip(mongos_package_name) }}"
loop: "{{ _mongos_package_list | zip(mongos_packages) }}"
when:
- ansible_os_family == "RedHat"
- _package not in packages or _version != _installed
2 changes: 1 addition & 1 deletion roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ roles:
version: 0.0.16
- name: mongos
src: https://github.com/nephelaiio/ansible-role-mongos.git
version: 0.0.15
version: 0.1.0
- name: mongodb
src: https://github.com/wpnops/ansible-role-mongodb.git
version: 0.1.11
Expand Down

0 comments on commit 3988c87

Please sign in to comment.