Skip to content

Commit

Permalink
trying to fix build ee (#46)
Browse files Browse the repository at this point in the history
* modified:   .github/deploy_ee/build_ee.yml
	modified:   .github/workflows/build_ee.yml

* modified:   .github/workflows/build_ee.yml

* modified:   README.md
  • Loading branch information
djdanielsson authored Aug 5, 2024
1 parent 82c8685 commit 3dfe615
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 46 deletions.
69 changes: 34 additions & 35 deletions .github/deploy_ee/build_ee.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
---
- name: Playbook to configure execution environments
hosts: builder
hosts: localhost
connection: local
gather_facts: false
# vars_files:
# - "../vaults/{{ env }}.yml"
pre_tasks:
- name: Validate that ansible-builder is installed on target system
block:
- name: Try command
- name: Try command # noqa command-instead-of-shell
ansible.builtin.shell: ansible-builder --version
register: r_builder
changed_when: false
rescue:
- name: Try to install with rpms
block:
- name: Install ansible-builder from rpm
ansible.builtin.dnf:
name:
- ansible-builder
- ansible-core
enablerepo: ansible-automation-platform-2.2-for-rhel-8-x86_64-rpms
state: present
become: true
rescue:
- name: Install ansible-builder from pip
ansible.builtin.pip:
name:
- ansible-builder
- ansible-core
state: latest
- name: Install ansible-builder from pip # noqa package-latest
ansible.builtin.pip:
name:
- ansible-builder
- ansible-core
state: latest

tasks:
- name: Include ee_builder role
ansible.builtin.include_role:
name: infra.ee_utilities.ee_builder
name: ee_builder
vars:
ee_pull_collections_from_hub: false
ee_container_runtime: podman
ee_base_image: quay.io/centos/centos:stream9
ee_list:
- name: config_as_code_ee
bindep:
- unzip
python:
- ansible-lint
- netaddr
collections:
- name: infra.controller_configuration
- name: infra.ah_configuration
- name: infra.ee_utilities
- name: infra.aap_utilities
- name: awx.awx
append:
- RUN dnf update -y
dependencies:
ansible_core:
package_pip: ansible-core
ansible_runner:
package_pip: ansible-runner
system:
- unzip
python:
- ansible-lint
- netaddr
galaxy:
collections:
- infra.controller_configuration
- infra.ah_configuration
- infra.eda_configuration
- infra.ee_utilities
- infra.aap_utilities
- awx.awx
build_steps:
append_final:
- RUN yum update -y
- RUN cat /etc/redhat-r*
...
14 changes: 9 additions & 5 deletions .github/workflows/build_ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,24 @@ jobs:
with:
python-version: '3.x'

- name: Install podman
run: sudo apt -y install podman

- name: Install Ansible and Ansible Builder
run: pip install --upgrade ansible-core ansible-builder
run: pip install --upgrade setuptools ansible-core ansible-builder

- name: Move ansible.cfg if exists
run: mv .github/files/ansible.cfg . || echo "Nothing to move"

- name: Install Collections
run: ansible-galaxy collection install -f -r .github/deploy_ee/requirements.yml

- name: Docker login
run: docker login -u="${{ inputs.quay_username }}+github_action" -p="${{ secrets.quay_token }}" quay.io
- name: Podman login
run: podman login quay.io --username "${{ inputs.quay_username }}+github_action" --password ${{ secrets.quay_token }}

- name: Run Ansible Playbook
run: ansible-playbook .github/deploy_ee/build_ee.yml -i .github/deploy_ee/inventory_ci.yml -l dev -e "ee_registry_username=${{ inputs.quay_username }}+github_action" -e "ee_registry_password=${{ secrets.quay_token }}" --connection=local -e "ee_registry_dest=quay.io/${{ inputs.quay_username }}/config_as_code_ee" -vvv
- name: Build EE
# run: ansible-playbook .github/deploy_ee/build_ee.yml -i .github/deploy_ee/inventory_ci.yml -l dev -e "ee_registry_username=${{ inputs.quay_username }}+github_action" -e "ee_registry_password=${{ secrets.quay_token }}" --connection=local -e "ee_registry_dest=quay.io/${{ inputs.quay_username }}/config_as_code_ee" -vvv
run: ansible-playbook .github/deploy_ee/build_ee.yml -e "ee_registry_username=${{ inputs.quay_username }}+github_action" -e "ee_registry_password=${{ secrets.quay_token }}" --connection=local -e "ee_registry_dest=quay.io/${{ inputs.quay_username }}/config_as_code_ee" -vvv
env:
ANSIBLE_HOST_KEY_CHECKING: false
...
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Various workflows and actions used in the infra collections for pre commit and p
## Infra AAP Configuration Collections Suite

|Collection Name|Purpose|
|:---:|:---:|
|[Controller Configuration](https://galaxy.ansible.com/infra/controller_configuration)|Automation controller configuration|
|[Hub Configuration](https://galaxy.ansible.com/infra/ah_configuration)|Automation hub configuration|
|[EE Utilities](https://galaxy.ansible.com/infra/ee_utilities)|Execution Environment creation utilities|
|[AAP installation Utilities](https://galaxy.ansible.com/infra/aap_utilities)|Ansible Automation Platform Utilities|
|[AAP Configuration Template](https://github.com/redhat-cop/aap_configuration_template)|Configuration Template for this suite|
|:-------------:|:-----:|
| [Controller Configuration](https://github.com/redhat-cop/controller_configuration) | Automation Controller configuration |
|[Hub Configuration](https://galaxy.ansible.com/infra/ah_configuration) | Automation hub configuration |
| [EDA Controller Configuration](https://github.com/redhat-cop/eda_configuration) | EDA Controller configuration |
| [EE Utilities](https://github.com/redhat-cop/ee_utilities) | Execution Environment creation utilities |
| [AAP installation Utilities](https://github.com/redhat-cop/aap_utilities) | Ansible Automation Platform utilities |
| [AAP Configuration Template](https://github.com/redhat-cop/aap_configuration_template) | Configuration Template for this suite |

0 comments on commit 3dfe615

Please sign in to comment.