Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSMDB fix roles and playbooks for AL #241

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@
- git
- wget
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8

- name: Install necessary tools for AL
yum:
name: "{{ packages }}"
vars:
packages:
- tar
- iproute
- openssl
when: ansible_distribution == "Amazon"
4 changes: 2 additions & 2 deletions psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dependency:
driver:
name: docker
platforms:
- name: ${MOLECULE_OS:-ubuntu2204}
image: "${MOLECULE_DISTRO:-geerlingguy/docker-ubuntu2204-ansible:latest}"
- name: ${MOLECULE_OS:-amazonlinux2023}
image: "${MOLECULE_DISTRO:-geerlingguy/docker-amazonlinux2023-ansible:latest}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
25 changes: 25 additions & 0 deletions psmdb-tarball/psmdb-tarball/playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,31 @@
- unzip
when: ansible_os_family == "RedHat" and ansible_distribution_major_version >= "8"

- name: install necessary rpm packages for AL
yum:
name: "{{ packages }}"
state: latest
vars:
packages:
- iproute
- tar
- bzip2-devel
- bzip2-libs
- gcc
- gcc-c++
- git
- make
- openssl-devel
- zlib-devel
- python3-pip
- python3-devel
- python3-ldap
- psmisc
- libffi-devel
- xz-devel
- unzip
when: ansible_distribution == "Amazon"

- name: install necessary rpm packages for RHEL9
yum:
name: "{{ packages }}"
Expand Down
51 changes: 51 additions & 0 deletions psmdb/psmdb/molecule/al2023-arm/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
dependency:
name: galaxy
driver:
name: ec2
platforms:
- name: al2023-arm-${BUILD_NUMBER}-${JOB_NAME}
region: us-west-2
image: ami-01167b661200e49e7
vpc_subnet_id: subnet-03136d8c244f56036
instance_type: c6g.large
ssh_user: ec2-user
root_device_name: /dev/sda1
instance_tags:
iit-billing-tag: jenkins-psmdb-worker
job-name: ${JOB_NAME}
provisioner:
name: ansible
log: True
playbooks:
create: ../../../../playbooks/create.yml
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../../playbooks/prepare.yml
cleanup: ../../playbooks/cleanup.yml
converge: ../../playbooks/playbook.yml
verifier:
name: testinfra
directory: ../../../tests/
additional_files_or_dirs:
- ../psmdb/tests/
options:
verbose: true
s: true
junitxml: al2023-arm-report.xml
scenario:
name: al2023-arm
converge_sequence:
- prepare
- converge
destroy_sequence:
- destroy
clenup_sequence:
- cleanup
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- cleanup
- destroy
51 changes: 51 additions & 0 deletions psmdb/psmdb/molecule/al2023/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
dependency:
name: galaxy
driver:
name: ec2
platforms:
- name: al2023-${BUILD_NUMBER}-${JOB_NAME}
region: us-west-2
image: ami-055e3d4f0bbeb5878
vpc_subnet_id: subnet-03136d8c244f56036
instance_type: t3.small
ssh_user: ec2-user
root_device_name: /dev/sda1
instance_tags:
iit-billing-tag: jenkins-psmdb-worker
job-name: ${JOB_NAME}
provisioner:
name: ansible
log: True
playbooks:
create: ../../../../playbooks/create.yml
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../../playbooks/prepare.yml
cleanup: ../../playbooks/cleanup.yml
converge: ../../playbooks/playbook.yml
verifier:
name: testinfra
directory: ../../../tests/
additional_files_or_dirs:
- ../psmdb/tests/
options:
verbose: true
s: true
junitxml: al2023-report.xml
scenario:
name: al2023
converge_sequence:
- prepare
- converge
destroy_sequence:
- destroy
clenup_sequence:
- cleanup
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- cleanup
- destroy
4 changes: 2 additions & 2 deletions psmdb/psmdb/molecule/docker/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dependency:
driver:
name: docker
platforms:
- name: ${MOLECULE_OS:-ubuntu2204}
image: "${MOLECULE_DISTRO:-geerlingguy/docker-ubuntu2204-ansible:latest}"
- name: ${MOLECULE_OS:-amazonlinux2023}
image: "${MOLECULE_DISTRO:-geerlingguy/docker-amazonlinux2023-ansible:latest}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
2 changes: 1 addition & 1 deletion roles/kerberos/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---


- name: Install necessary tools for Debain
- name: Install necessary tools for Debian
apt:
name: "{{ packages }}"
update_cache: yes
Expand Down
10 changes: 5 additions & 5 deletions roles/kmip/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- git
- python3-pip
- python3-sqlalchemy
when: ansible_distribution_major_version >= "8"
when: ansible_distribution_major_version|int >= 8

- name: Install python2 enum
pip:
Expand All @@ -39,17 +39,17 @@
- setuptools<71.0.0
state: present
executable: pip3
when: ansible_distribution_major_version > "8"
when: ansible_distribution_major_version|int >= 8

- name: Debug python3 version RHEL8
shell: "python3 --version"
register: python_version
when: ansible_distribution_major_version >= "8"
when: ansible_distribution_major_version|int >= 8

- name: Display python version
debug:
var: python_version.stdout
when: ansible_distribution_major_version >= "8"
when: ansible_distribution_major_version|int >= 8

- name: Install python3 setuptools
pip:
Expand All @@ -73,4 +73,4 @@
dest: /usr/bin/python
state: link
force: yes
when: ansible_distribution_major_version > "7"
when: ansible_distribution_major_version|int >= 8
10 changes: 10 additions & 0 deletions roles/openldap/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@
- openldap-servers
- openldap-clients
when: ansible_distribution_major_version == "9"

- name: Install required packages
yum:
state: present
name:
- openldap
- openldap-devel
- openldap-servers
- openldap-clients
when: ansible_distribution == "Amazon"
2 changes: 1 addition & 1 deletion roles/openldap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- include_vars: "RedHat-vars.yml"
when: ansible_os_family == "RedHat" and ansible_distribution_major_version <= "7"
- include_vars: "RedHat8-vars.yml"
when: ansible_os_family == "RedHat" and ansible_distribution_major_version >= "8"
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8
- include_tasks: "{{ansible_os_family}}.yml"

- name: Start ldap service
Expand Down
22 changes: 15 additions & 7 deletions roles/vault/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@
state: present

- name: Add HashiCorp yum repo
command: yum-config-manager --add-repo=https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
command: yum-config-manager --add-repo=https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
args:
creates: /etc/yum.repos.d/hashicorp.repo
when: ansible_distribution_major_version > "7"
when: ansible_distribution == "Amazon"

- name: Fix Hashicorp yum repo
shell: |
sed 's/\$releasever/{{ ansible_distribution_major_version }}/g' -i /etc/yum.repos.d/hashicorp.repo
when: ansible_distribution_major_version > "7"
- block:
- name: Add HashiCorp yum repo
command: yum-config-manager --add-repo=https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
args:
creates: /etc/yum.repos.d/hashicorp.repo
when: ansible_distribution_major_version|int >= 8

- name: Fix Hashicorp yum repo
shell: |
sed 's/\$releasever/{{ ansible_distribution_major_version }}/g' -i /etc/yum.repos.d/hashicorp.repo
when: ansible_distribution_major_version|int >= 8
when: ansible_distribution != "Amazon"

- name: Install Vault via yum
yum:
name: vault
state: present
when: ansible_distribution_major_version > "7"
when: ansible_distribution_major_version|int >= 8

- name: Install Vault for Centos7 from archive
yum: name=https://archive.releases.hashicorp.com/RHEL/7/x86_64/stable/vault-1.17.2-1.x86_64.rpm state=present
Expand Down