ansible-role-postgresql icon indicating copy to clipboard operation
ansible-role-postgresql copied to clipboard

Create Arch.yml

Open C0rn3j opened this issue 3 years ago • 1 comments

Fixes #189

C0rn3j avatar Aug 19 '22 22:08 C0rn3j

@C0rn3j : I think you should extend the molecule tests in this role to test the role against an arch container. I did something similar with Rocky Linux 9. You may get inspiration from here: https://github.com/geerlingguy/ansible-role-postgresql/pull/224/files

fhsctv avatar Aug 30 '22 13:08 fhsctv

@C0rn3j : No interest in fully implementing Arch Support?

fhsctv avatar Nov 02 '22 21:11 fhsctv

@geerlingguy How would I go about testing against my own image?

I see that the molecule tests try against your own repository but you do not have one set up for Arch Linux.

I was able to write a bare Dockerfile for Arch to be included in your repo, but was not able to properly test it.

Also am unsure why initctl_faker and rsyslog are there.

FROM archlinux
LABEL maintainer="Jeff Geerling"

ENV pip_packages "ansible"

# Install dependencies.
RUN pacman -Syu --noconfirm --needed \
       python-setuptools \
       python-pip \
       python-yaml \
       systemd sudo iproute2 \
    && rm -Rf /usr/share/doc && rm -Rf /usr/share/man

#RUN sed -i 's/^\($ModLoad imklog\)/#\1/' /etc/rsyslog.conf

# Fix potential UTF-8 errors with ansible-test.
RUN locale-gen en_US.UTF-8

# Install Ansible via Pip.
RUN pip install $pip_packages

COPY initctl_faker .
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl

# Install Ansible inventory file.
RUN mkdir -p /etc/ansible
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts

# Remove unnecessary getty and udev targets that result in high CPU usage when using
# multiple containers with Molecule (https://github.com/ansible/molecule/issues/1104)
RUN rm -f /lib/systemd/system/systemd*udev* \
  && rm -f /lib/systemd/system/getty.target

VOLUME ["/sys/fs/cgroup", "/tmp", "/"]
CMD ["/lib/systemd/systemd"]

C0rn3j avatar Nov 23 '22 10:11 C0rn3j

I would like to get Arch Linux supported here (and add tests to a couple other roles too), but right now I'm just marking some issues as planned that I'd like to get to but can't yet. I would be glad to add on an archlinux testing image, though it seems Arch likes to update things quite rapidly, so maintenance (where I like to stick to a particular version, like RHEL 7/8/9) could be a bit weird.

geerlingguy avatar Nov 27 '22 05:11 geerlingguy

Alternatively, since Arch is a little weird in that regard, I'd be willing to merge this change without adding archlinux to the testing suite (for now at least... we'll see how maintenance goes long term). But please do add it in the listing for supported distros in the meta/main.yml file.

geerlingguy avatar Nov 27 '22 05:11 geerlingguy

I've dropped the test and added the meta.yml entry for now.

Arch likes to update things quite rapidly, so maintenance (where I like to stick to a particular version, like RHEL 7/8/9) could be a bit weird

I think the problematic things with these minimal images would most likely be the systemd hacks, since in my Dockerfile I used pip to install Ansible itself, so it should hopefully mostly be the same as other distros.

C0rn3j avatar Nov 27 '22 10:11 C0rn3j