Closed sbesson closed 5 years ago
@sbesson Thank for contributing.
This PR fixes the issue in RHEL distros then I tend to agree, doesn't like to add external dependencies because of security issues but which
is pretty standard and widely used. Then would you mind adding a short description on in the CHANGELOG.md about this change?
@sbesson you may not need to be a root install a package, This lines allows the user user
perform sudo task https://github.com/rvm/rvm1-ansible/blob/master/tests/dockerfiles/centos7/Dockerfile#L9-L10.
@sbesson I think we have to append sudo group to the user
RUN useradd -ms /bin/bash user \
-G sudo user \
&& echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
@lpaulmp: 8d6e454 should implement the suggestion from https://github.com/rvm/rvm1-ansible/pull/165#discussion_r169755320 i.e. the system dependencies installation are handled in a dedicated sub-playbook included with ignore_errors: true
to prevent breakages when the remote user cannot perform privilege escalation.
The default CentOS/RHEL installation does not include
which
which is a prerequisite for the role installation. The CentOS Docker image used for testing in Travis works around this limitation by installingwhich
on top of the basecentos:centos7
image.Consumers of the role either in a playbook or as a dependency of a downstream role need to use
pre_task
,include_role
or have another role installing the prerequisites - see https://github.com/openmicroscopy/ansible-role-jekyll-build/pull/10.This PR proposes to tackle this limitation by conditionally installing the
which
package when appropriate using theansible_distribution
. The main impact of this change is its requirement for settinggather_facts
to its defaulttrue
value in the consuming playbooks.Similar issues have been reported for other distributions and could be addressed the same way - see https://github.com/rvm/rvm1-ansible/issues/32