Skip to content

Commit

Permalink
Port to ansible-core+collections
Browse files Browse the repository at this point in the history
  • Loading branch information
yselkowitz committed Jun 24, 2022
1 parent 6d44e0c commit 475da2a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions images/installer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ COPY images/installer/root /
# Add origin repo for including the oc client
COPY images/installer/origin-extra-root /
# Install openshift-ansible RPMs
RUN yum install -y centos-release-ansible-29 epel-release python3 && \
RUN yum install -y epel-release && \
yum config-manager --enable built > /dev/null && \
yum install --setopt=tsflags=nodocs -y \
'ansible < 2.10' \
ansible-core \
openshift-ansible-test && \
yum clean all

Expand Down
12 changes: 8 additions & 4 deletions openshift-ansible.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ URL: https://github.com/openshift/openshift-ansible
Source0: https://github.com/openshift/openshift-ansible/archive/%{commit}/%{name}-%{version}.tar.gz
BuildArch: noarch

Requires: ansible >= 2.9.5
Requires: (ansible >= 2.9.10 or ansible-core >= 2.11.0)
Requires: ansible-collection-community-general
Requires: ansible-collection-ansible-posix
Requires: openshift-clients
Requires: openssl

Expand Down Expand Up @@ -61,10 +63,12 @@ cp -rp test %{buildroot}%{_datadir}/ansible/%{name}/
%package test
Summary: Openshift and Atomic Enterprise Ansible Test Playbooks
Requires: %{name} = %{version}-%{release}
Requires: ansible >= 2.9.5
Requires: (ansible >= 2.9.10 or ansible-core >= 2.11.0)
Requires: ansible-collection-community-general
Requires: ansible-collection-ansible-posix
Requires: openssh-clients
#Requires: python3-boto
Requires: python3-boto3
#Requires: python38-boto
#Requires: python38-boto3
BuildArch: noarch

%description test
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Versions are pinned to prevent pypi releases arbitrarily breaking
# tests with new APIs/semantics. We want to update versions deliberately.
ansible<2.10
ansible-core<2.13
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--
collections:
- name: ansible.posix
- name: community.general
4 changes: 3 additions & 1 deletion roles/openshift_node/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ galaxy_info:
- 7
categories:
- cloud
dependencies: []
dependencies:
- ansible.posix
- community.general
8 changes: 4 additions & 4 deletions roles/openshift_node/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# startup, but if the network service is restarted this setting is
# lost. Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1372388
- name: Enable IP Forwarding
sysctl:
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: 1
sysctl_file: "/etc/sysctl.d/99-openshift.conf"
Expand All @@ -45,19 +45,19 @@
- not ('Could not find the requested service' in service_status.msg)

- name: Setting sebool container_manage_cgroup
seboolean:
ansible.posix.seboolean:
name: container_manage_cgroup
state: yes
persistent: yes

- name: Setting sebool virt_use_samba
seboolean:
ansible.posix.seboolean:
name: virt_use_samba
state: yes
persistent: yes

- name: Setting sebool container_use_cephfs
seboolean:
ansible.posix.seboolean:
name: container_use_cephfs
state: yes
persistent: yes
Expand Down
2 changes: 1 addition & 1 deletion roles/openshift_node/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

# persistent storage in journal is needed for MachineConfig to work
- name: Enable persistent storage on journal
ini_file:
community.general.ini_file:
dest: "/etc/systemd/journald.conf"
section: Journal
option: Storage
Expand Down

0 comments on commit 475da2a

Please sign in to comment.