-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new role to build for dev spaces
- Loading branch information
Showing
11 changed files
with
469 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
-----BEGIN PGP SIGNATURE----- | ||
|
||
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVNRfgACgkQTiIiIXrU | ||
DNFGcwv9E27tPzmZ4somALbAjJ86sSOnDBu0IQHdXt3ZU4Ye2Ea02kTrUigKE17q | ||
hjqG33X6vfiJmoXA/64Q/YQzvtYoYPcN4NoTviJGkVmhF5Q6zis/m2p2B09mWCD4 | ||
RHHrTj4wAT/8puMXeqIeFagi6bDYZnW7Bx5vDLkVVQew8cg2UNKf55S/FSzmGMzt | ||
f8UfUAwJEpuwQWb/HFNi/yP/9IDfRbR7JMhZhXOcNZ352epTYrzMUWG5GFklziTI | ||
eA8g2CeFTJb2z+am6viHP5D2QQtKU9LyojVhk+9f0YyUkEsD5BTpBiR0ZfZHbbAS | ||
TrOgBWSHkSFdDMjyyubTOQmu9AExEdDx+c3rW6lpNZC/KsuP6MbbWmJ2X4oXWZDC | ||
jkZ7xIcTo5XQlxONA2NZHAEfYgr7NOdDSRFr4HWaDIQ8vx7GdhLXWkGU8Leo40wu | ||
q4zn3u3CaDKpboqWF9sfvEzyGXoL6pWlSPdy6U4rGFd1qC5SdrZuo8NZeVzVN0B2 | ||
cC2OsWVG | ||
=wS52 | ||
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVqCc4ACgkQTiIiIXrU | ||
DNFHBgwArCxo9FM4VSLHk2RYQ+R0AfvSsLqmx9lhSurCErHQ6NTNp2bQjIkc8na5 | ||
ee5ZmyqVz9Uso+B/sNei7q7RbB7xTaU02Z5trbTJ9sXbTqlcab/U/svInvScrQCL | ||
CNecgAv8hNfn2Mc6yx4KKNCuyf4/kErP1EKuUrVwvMIrpyl9RFNEnz8EcEx9qxAP | ||
cRWNucHsRRu1CQrxuIZf2EsE5AsL1NSgYuMWMBFfLmoCot0FzGakUTG+a1C2n1Cg | ||
nRtrvozbLLD9a1rbvVWtahHybGuz+BCVHbtLGndxNSHH0s5iGFAHDXSwC+tPuSXH | ||
knVOBulIU7Fg3xG6TvLuTI/mEEMN0qR+U2r65TSlUXAnG8h11CC2oMYEljZrNMGh | ||
iB3b1UFFG6OOHg3Le06RjJdVFSoSSTW9ylGrDIpiSJsAnp3lWwWoT3LQ/jehsr22 | ||
fVGJ10O0yM/0Y+UCDomv7FRODb51JgI+t+l9iGda0WklHAA23NuQEuekQGkm/oJr | ||
IgUeStCS | ||
=N8pD | ||
-----END PGP SIGNATURE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
ee_version: 3 | ||
dest_dir: /home/adworjan/ansible/builder/shadowmaneedev/ | ||
pah_name: towerpah.shadowman.dev | ||
image_name: shadowmaneedev | ||
bindep_file: bindep.txt | ||
python_requirements_file: requirements.txt | ||
galaxy_requirements_file: requirements.yml | ||
ee_base_image: towerpah.shadowman.dev/ansible-automation-platform/ee-minimal-rhel8:2.15 | ||
ee_base_sig_name: registry.redhat.io/ansible-automation-platform/ee-minimal-rhel8:2.15 | ||
galaxy_keyring: /home/adworjan/ansible/builder/shadowmanee/fullkeyring.kbx | ||
ee_package_manager_path: /usr/bin/microdnf | ||
ee_build_files: | ||
- src: /home/adworjan/ansible/builder/shadowmaneedev/ansible.cfg | ||
dest: configs | ||
- src: /home/adworjan/ansible/builder/shadowmaneedev/.bashrc | ||
dest: configs | ||
- src: /home/adworjan/ansible/builder/shadowmaneedev/shells | ||
dest: configs | ||
ee_bindep: | ||
- python3-jinja2 [platform:rpm] | ||
- which [platform:rpm] | ||
- git [platform:rpm] | ||
- libcurl-devel [platform:rpm] | ||
- gcc [platform:rpm] | ||
- python39-devel [platform:rpm] | ||
- openssl-devel [platform:rpm] | ||
- libxml2-devel [platform:rpm] | ||
- libxslt-devel [platform:rpm] | ||
ee_python: | ||
- scp | ||
- pyats | ||
- genie | ||
- python-jenkins | ||
- pan-os-python==1.8.0 | ||
- pan-python==0.17.0 | ||
- panos-upgrade-assurance==0.3.0 | ||
ee_collections: | ||
- name: ansible.windows | ||
- name: community.windows | ||
- name: microsoft.ad | ||
- name: ansible.posix | ||
- name: vmware.vmware_rest | ||
version: 1.0.1 | ||
- name: ansible.netcommon | ||
- name: ansible.utils | ||
- name: community.crypto | ||
- name: community.general | ||
- name: community.vmware | ||
- name: cloud.terraform | ||
- name: servicenow.itsm | ||
- name: vyos.vyos | ||
- name: cisco.ios | ||
- name: arista.eos | ||
- name: infra.osbuild | ||
- name: azure.azcollection | ||
- name: f5networks.f5_modules | ||
- name: citrix.adc | ||
- name: shadowman.reports | ||
- name: redhat.rhv | ||
- name: redhat.satellite | ||
- name: redhat.insights | ||
- name: ansible.controller | ||
- name: paloaltonetworks.panos | ||
- name: ibm.qradar | ||
- name: containers.podman | ||
- name: community.postgresql | ||
- name: redhat.openshift | ||
ee_prepend_galaxy: | ||
- ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg | ||
ee_prepend_builder: | ||
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.13-for-rhel-8-x86_64-rpms" | ||
ee_prepend_final: | ||
- ENV PKGMGR_OPTS "--nodocs --setopt install_weak_deps=0 --enablerepo=rhocp-4.13-for-rhel-8-x86_64-rpms" | ||
ee_append_final: | ||
- RUN microdnf install -y yum-utils | ||
- RUN dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo | ||
- RUN dnf install -y terraform | ||
- RUN microdnf reinstall tzdata -y | ||
- RUN git clone -b citrix.adc --single-branch https://github.com/netscaler/ansible-collection-netscaleradc.git /tmp/citrix | ||
- RUN pip3 install /tmp/citrix/deps/nitro-python-1.0_kamet.tar.gz | ||
- RUN rm -rf /tmp/citrix/ | ||
- RUN rm -f /etc/ansible/ansible.cfg | ||
- RUN microdnf clean all | ||
- RUN dnf clean all | ||
- COPY _build/configs/shells /etc/shells | ||
- COPY _build/configs/.bashrc /home/runner/.bashrc | ||
- RUN printf "export CONTAINER_NAME=ansibleee\n" >> /home/runner/.bashrc | ||
- RUN for dir in /home/runner /home/runner/.ansible /home/runner/.ansible/tmp /runner /home/runner /runner/env /runner/inventory /runner/project /runner/artifacts ; do mkdir -m 0775 -p $dir ; chmod -R g+rwx $dir ; chgrp -R root $dir ; done && for file in /home/runner/.ansible/galaxy_token /etc/passwd /etc/group ; do touch $file ; chmod g+rw $file ; chgrp root $file ; done | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
- name: Pull builder images | ||
containers.podman.podman_image: | ||
name: "{{ item }}" | ||
username: "{{ pah_user }}" | ||
password: "{{ pah_pass }}" | ||
force: true | ||
loop: | ||
- "{{ ee_base_image }}" | ||
# - "{{ ee_builder_image }}" | ||
when: ee_version == 1 or ee_version == 3 | ||
|
||
- name: Login to PAH | ||
containers.podman.podman_login: | ||
username: "{{ pah_user }}" | ||
password: "{{ pah_pass }}" | ||
registry: "{{ pah_name }}" | ||
when: ee_version == 2 | ||
|
||
- name: Delete old EE | ||
containers.podman.podman_image: | ||
name: "{{ pah_name }}/{{ image_name }}" | ||
state: absent | ||
force: true | ||
|
||
- name: Template out builder files | ||
ansible.builtin.template: | ||
src: "{{ item }}.j2" | ||
dest: "{{ dest_dir }}{{ item }}" | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
loop: | ||
- ansible.cfg | ||
- bindep.txt | ||
- execution-environment.yml | ||
- requirements.txt | ||
- requirements.yml | ||
- shells | ||
- .bashrc | ||
|
||
- name: Build new EE on version 1 or 3 without signature verification | ||
ansible.builtin.command: | ||
cmd: 'ansible-builder build -t {{ pah_name }}/{{ image_name }} --prune-images --galaxy-keyring={{ galaxy_keyring }}' | ||
chdir: "{{ dest_dir }}" | ||
changed_when: true | ||
when: ee_version == 1 or ee_version == 3 | ||
|
||
- name: Build new EE with container signature verification on version 2 | ||
ansible.builtin.command: | ||
cmd: 'ansible-builder build -t {{ pah_name }}/{{ image_name }} --prune-images --galaxy-keyring={{ galaxy_keyring }} --container-policy=system' | ||
chdir: "{{ dest_dir }}" | ||
changed_when: true | ||
when: ee_version == 2 | ||
|
||
- name: Create new tag on EE based on date time of creation | ||
containers.podman.podman_tag: | ||
image: "{{ pah_name }}/{{ image_name }}" | ||
target_names: | ||
- "{{ pah_name }}/{{ image_name }}:{{ ansible_date_time.iso8601_basic_short }}" | ||
|
||
- name: Push new EE | ||
containers.podman.podman_image: | ||
name: "{{ pah_name }}/{{ image_name }}" | ||
tag: "{{ item }}" | ||
push: true | ||
username: "{{ pah_user }}" | ||
password: "{{ pah_pass }}" | ||
loop: | ||
- "{{ ansible_date_time.iso8601_basic_short }}" | ||
- latest | ||
|
||
- name: Remove extra tag | ||
containers.podman.podman_image: | ||
name: "{{ pah_name }}/{{ image_name }}" | ||
tag: "{{ ansible_date_time.iso8601_basic_short }}" | ||
state: absent | ||
|
||
- name: Update Execution Environment Version in Controller with new version | ||
ansible.controller.execution_environment: | ||
name: "Automation Hub Shadowman execution environment" | ||
image: "{{ pah_name }}/{{ image_name }}:{{ ansible_date_time.iso8601_basic_short }}" | ||
delegate_to: localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
PROMPT_COMMAND=__prompt_command | ||
|
||
__prompt_command() { | ||
local RC="$?" | ||
RC_MSG="" | ||
if [ "$RC" != 0 ]; then | ||
RC_MSG="\[$(tput sgr0)\]\[\033[38;5;9m\]$RC\[$(tput sgr0)\]" | ||
fi | ||
PS1="\[\033[38;5;56m\]\u\[$(tput sgr0)\]\[\033[38;5;8m\]@\[$(tput sgr0)\]\[\033[38;5;130m\]${CONTAINER_NAME}\[$(tput sgr0)\]: \[$(tput sgr0)\]\[\033[38;5;25m\]\w\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;28m\]\$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')\[$(tput sgr0)\]$RC_MSG\n\\$ \[$(tput sgr0)\]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[galaxy] | ||
server_list = automation_hub_cert,automation_hub_pub,automation_hub_comm,automation_hub_val | ||
ignore_certs = yes | ||
|
||
[galaxy_server.automation_hub_cert] | ||
url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/rh-certified/ | ||
token={{ lookup('env', 'AH_API_TOKEN') }} | ||
|
||
[galaxy_server.automation_hub_pub] | ||
url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/published/ | ||
token={{ lookup('env', 'AH_API_TOKEN') }} | ||
|
||
[galaxy_server.automation_hub_comm] | ||
url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/community/ | ||
token={{ lookup('env', 'AH_API_TOKEN') }} | ||
|
||
[galaxy_server.automation_hub_val] | ||
url={{ lookup('env', 'AH_HOST') }}api/galaxy/content/validated/ | ||
token={{ lookup('env', 'AH_API_TOKEN') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% if ee_bindep is defined %} | ||
{% if ee_bindep|length %} | ||
{% for item in ee_bindep %} | ||
{{ item }} | ||
{% endfor %} | ||
{% endif %} | ||
{% endif %} |
Oops, something went wrong.