Skip to content

Commit 74c8dcc

Browse files
Chaffelsonwmudge
andauthored
Prepare integrated service release (#21)
* Replace ansible.cfg variables and add Cloudera default collections (#20) * Replace ansible.cfg with runtime ENV vars and Runner envvar file * Update collections to include Cloudera defaults * Update to install both collections and roles to non-standard locations * Convert to standard AsciiDoc and update for content changes Signed-off-by: Webster Mudge <[email protected]> * Moved Ansible Collection deps for cloudera.cluster to galaxy.yml in that Collection Signed-off-by: Daniel Chaffelson <[email protected]> Co-authored-by: Webster Mudge <[email protected]>
1 parent 65beb94 commit 74c8dcc

File tree

5 files changed

+37
-29
lines changed

5 files changed

+37
-29
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ ARG BASE_IMAGE_TAG
1010
# Copy Payload
1111
COPY payload /runner/
1212

13-
# Need to match the python devel ver to base image ver, currently 3.8
13+
# NOTE: Need to match the python devel ver to base image ver, currently 3.8
1414
# Update readme if you change Python version!
15+
16+
# NOTE: Ansible collections and roles are installed into a non-default location
17+
# Downstream implementers and users are expected to include this location if
18+
# these built-ins are desired by setting the Ansible collections path variable
1519
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
1620
&& cp /runner/deps/*.repo /etc/yum.repos.d/ \
1721
&& dnf install -y python38-devel git curl which bash gcc terraform \
1822
&& rm -rf /var/cache/dnf \
1923
&& pip install -r /runner/deps/python_base.txt \
20-
&& ansible-galaxy install -r /runner/deps/ansible.yml \
24+
&& ansible-galaxy role install -p /opt/cldr-runner/roles -r /runner/deps/ansible.yml \
25+
&& ansible-galaxy collection install -p /opt/cldr-runner/collections -r /runner/deps/ansible.yml \
2126
&& mkdir -p /home/runner/.ansible/log \
2227
&& mv /runner/bashrc /home/runner/.bashrc
2328

payload/ansible.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

payload/deps/ansible.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
# - name: https://github.com/myuser/myrepo.git
44
# type: git
55
# version: mybranch
6+
67
collections:
7-
- community.general
8-
- community.postgresql
9-
- community.crypto
10-
- community.mysql
11-
- ansible.posix
12-
- ansible.netcommon
13-
- amazon.aws
14-
- community.aws
15-
- google.cloud
16-
- azure.azcollection
17-
# - netapp.azure
18-
- name: https://github.com/ansible-collections/netapp.git#ansible_collections/netapp/azure
19-
type: git
208

9+
# Cloudera collections
10+
- name: https://github.com/cloudera-labs/cloudera.cluster.git
11+
type: git
12+
- name: https://github.com/cloudera-labs/cloudera.cloud.git
13+
type: git
14+
- name: https://github.com/cloudera-labs/cloudera.exe.git
15+
type: git
16+
2117
# Append other roles to this list.
2218
roles:
2319
- src: geerlingguy.postgresql

payload/env/envvars

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
---
2-
ANSIBLE_CONFIG=/runner/ansible.cfg
3-
ANSIBLE_LOG_PATH=/home/runner/.ansible/log/ansible-runner.log
2+
3+
ANSIBLE_LOG_PATH=/home/runner/.ansible/log/ansible-runner.log
4+
ANSIBLE_INVENTORY="inventory"
5+
ANSIBLE_CALLBACK_WHITELIST="ansible.posix.profile_tasks"
6+
ANSIBLE_GATHERING="smart"
7+
ANSIBLE_DEPRECATION_WARNINGS=false
8+
ANSIBLE_SSH_RETRIES=10
9+
10+
# Users and downstream images are expected to set the collections and role paths
11+
# The defaults are set to a non-standard location to keep the runner neutral,
12+
# but can provide builtin support via a simple override if needed
13+
#ANSIBLE_COLLECTIONS_PATH=
14+
#ANSIBLE_ROLES_PATH=

run_project.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ if [ ! "$(docker ps -q -f name="${CONTAINER_NAME}")" ]; then
4949
-v "${PROJECT_DIR}":/runner/project \
5050
--mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock \
5151
-e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock" \
52+
-e ANSIBLE_INVENTORY="inventory" \
53+
-e ANSIBLE_CALLBACK_WHITELIST="ansible.posix.profile_tasks" \
54+
-e ANSIBLE_GATHERING="smart" \
55+
-e ANSIBLE_DEPRECATION_WARNINGS=false \
56+
-e ANSIBLE_HOST_KEY_CHECKING=true \
57+
-e ANSIBLE_SSH_RETRIES=10 \
58+
-e ANSIBLE_COLLECTIONS_PATH="/opt/cldr-runner/collections" \
59+
-e ANSIBLE_ROLES_PATH="/opt/cldr-runner/roles" \
5260
--mount "type=bind,source=${HOME}/.aws,target=/home/runner/.aws" \
5361
--mount "type=bind,source=${HOME}/.config,target=/home/runner/.config" \
5462
--mount "type=bind,source=${HOME}/.ssh,target=/home/runner/.ssh" \

0 commit comments

Comments
 (0)