Skip to content
Open
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
16 changes: 8 additions & 8 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ ENV OPERATOR=/usr/local/bin/ansible-operator \
USER_NAME=ansible-operator\
HOME=/opt/ansible \
ANSIBLE_LOCAL_TMP=/opt/ansible/tmp \
DOWNSTREAM_BUILD_PYTHON=python3.9
DOWNSTREAM_BUILD_PYTHON=python3.12

RUN yum install -y \
glibc-langpack-en \
git \
make \
python3 \
python3-devel \
python3-pip \
python3-setuptools \
python3.12 \
python3.12-devel \
python3.12-pip \
python3.12-setuptools \
gcc \
openldap-devel \
&& python3.9 -m pip install --no-cache-dir --upgrade setuptools pip \
&& python3.9 -m pip install --no-cache-dir \
&& python3.12 -m pip install --no-cache-dir --upgrade setuptools pip \
&& python3.12 -m pip install --no-cache-dir \
kubernetes \
"ansible-core" \
"molecule" \
&& yum clean all \
&& rm -rf $HOME/.cache \
&& curl -L https://github.com/openshift/okd/releases/download/4.12.0-0.okd-2023-04-16-041331/openshift-client-linux-4.12.0-0.okd-2023-04-16-041331.tar.gz | tar -xz -C /usr/local/bin
&& curl -L https://github.com/okd-project/okd/releases/download/4.20.0-okd-scos.17/openshift-client-linux-amd64-rhel9-4.20.0-okd-scos.17.tar.gz | tar -xz -C /usr/local/bin
# TODO: Is there a better way to install this client in ubi8?

COPY . /opt/ansible
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ provisioner:
host_vars:
localhost:
virtualenv: ${MOLECULE_EPHEMERAL_DIRECTORY}/virtualenv
virtualenv_command: '{{ ansible_playbook_python }} -m virtualenv'
virtualenv_interpreter: '{{ virtualenv }}/bin/python'
virtualenv_command: '{{ ansible_playbook_python }} -m venv'
virtualenv_interpreter: '{{ virtualenv }}/bin/python3'
playbook_namespace: molecule-tests
env:
ANSIBLE_FORCE_COLOR: 'true'
Expand Down
1 change: 1 addition & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- kubernetes>=12.0.0
- coverage
- python-ldap
- packaging
virtualenv: "{{ virtualenv }}"
virtualenv_command: "{{ virtualenv_command }}"
virtualenv_site_packages: no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
assert:
that:
- result is changed
- admins_group
- devs_group
- admins_group | length > 0
- devs_group | length > 0
- '"jane.smith@ansible.org" in admins_group.users'
- '"jim.adams@ansible.org" in admins_group.users'
- '"jordanbulls@ansible.org" in devs_group.users'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
assert:
that:
- result is changed
- banking_group
- insurance_group
- banking_group | length > 0
- insurance_group | length > 0
- '"james-allan@ansible.org" in banking_group.users'
- '"gordon-kane@ansible.org" in banking_group.users'
- '"alice-courtney@ansible.org" in insurance_group.users'
Expand Down
3 changes: 2 additions & 1 deletion molecule/default/roles/openshift_adm_groups/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
spec:
containers:
- name: ldap
image: bitnami/openldap
# bitnami is no longer supporting this image. we should probably find a replacement
image: docker.io/bitnamilegacy/openldap:latest
env:
- name: LDAP_ADMIN_USERNAME
value: "{{ ldap_admin_user }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

- pip:
name:
- kubernetes
virtualenv: "{{ venv }}"
virtualenv_command: "{{ virtualenv_command }}"
virtualenv_site_packages: false
- python-ldap
state: absent

- name: Load test configurations
set_fact:
Expand All @@ -27,15 +25,16 @@
config: "{{ configs.simple }}"
register: result
ignore_errors: true
vars:
ansible_python_interpreter: "{{ venv }}/bin/python"

- name: Check that module failed gracefully
assert:
that:
- '"Failed to import the required Python library (python-ldap)" in result.msg'

always:
- pip:
name:
- python-ldap
- name: Remove temp directory
file:
path: "{{ test_dir }}"
Expand Down
16 changes: 8 additions & 8 deletions molecule/default/roles/openshift_adm_groups/tasks/rfc2307.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
assert:
that:
- result is changed
- admins_group
- devs_group
- admins_group | length > 0
- devs_group | length > 0
- '"jane.smith@ansible.org" in admins_group.users'
- '"jim.adams@ansible.org" in devs_group.users'
- '"jordanbulls@ansible.org" in devs_group.users'
Expand All @@ -89,8 +89,8 @@
assert:
that:
- result is changed
- admins_group
- devs_group
- admins_group | length > 0
- devs_group | length > 0
- '"jane.smith@ansible.org" in admins_group.users'
- '"jim.adams@ansible.org" in devs_group.users'
- '"jordanbulls@ansible.org" in devs_group.users'
Expand All @@ -110,8 +110,8 @@
assert:
that:
- result is changed
- admins_group
- devs_group
- admins_group | length > 0
- devs_group | length > 0
- '"cn=Jane,ou=people,ou=rfc2307,"+ldap_root in admins_group.users'
- '"cn=Jim,ou=people,ou=rfc2307,"+ldap_root in devs_group.users'
- '"cn=Jordan,ou=people,ou=rfc2307,"+ldap_root in devs_group.users'
Expand All @@ -131,8 +131,8 @@
assert:
that:
- result is changed
- admins_group
- devs_group
- admins_group | length > 0
- devs_group | length > 0
- '"jane.smith@ansible.org" in admins_group.users'
- '"jim.adams@ansible.org" in devs_group.users'
- '"jordanbulls@ansible.org" in devs_group.users'
Expand Down
3 changes: 2 additions & 1 deletion molecule/default/tasks/openshift_prune_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,6 @@
ignore_errors: true

when:
- registry.public_hostname
- registry.public_hostname is not none
- registry.public_hostname | length > 0
- registry.check.reached
5 changes: 1 addition & 4 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@

tasks:
- pip:
name: kubernetes-validate==1.12.0
virtualenv: "{{ virtualenv }}"
virtualenv_command: "{{ virtualenv_command }}"
virtualenv_site_packages: no
name: kubernetes-validate==1.34.1

- import_tasks: tasks/validate_installed.yml

Expand Down