Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM - Publish on automation hub using Service account credentials #584

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions playbooks/refresh-automation-hub-token/run.yaml

This file was deleted.

18 changes: 13 additions & 5 deletions roles/upload-ansible-collection-fork/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@

- debug: var=ansible_galaxy_collection_tarballs

- name: Publish collection to Ansible Galaxy / Automation Hub
environment:
ANSIBLE_CONFIG: "{{ _ansiblecfg_tmp.path }}"
shell: "{{ ansible_galaxy_executable }} -vvv collection publish {{ item.path }}"
with_items: "{{ ansible_galaxy_collection_tarballs.files }}"
# - name: Publish collection to Ansible Galaxy / Automation Hub
# environment:
# ANSIBLE_CONFIG: "{{ _ansiblecfg_tmp.path }}"
# shell: "{{ ansible_galaxy_executable }} -vvv collection publish {{ item.path }}"
# with_items: "{{ ansible_galaxy_collection_tarballs.files }}"

# This is a temporary workaround before the following PR
# https://github.com/ansible/ansible/pull/83145 is released (2.19)
- name: Publish collection using ansible devel version
include_tasks: publish-collection-with-ansible-devel.yml
vars:
ansible_config_file_path: "{{ _ansiblecfg_tmp.path }}"
collection_tarballs_files: "{{ ansible_galaxy_collection_tarballs.files }}"

always:
- name: Shred ansible-galaxy credentials
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
- name: Run our-ensure-python role
include_role:
name: our-ensure-python
vars:
ensure_python__version: "3.11"

- name: Run ensure-virtualenv role
include_role:
name: ensure-virtualenv

- name: Setup base virtualenv_options
set_fact:
_virtualenv_options: "--python python3.11"

- name: Create virtualenv for ansible-test
shell: "virtualenv {{ _virtualenv_options }} ~/venv"

- name: Install pytest-forked into virtualenv
environment:
ANSIBLE_SKIP_CONFLICT_CHECK: '1'
shell: '~/venv/bin/pip install git+https://github.com/ansible/ansible@devel'

- name: Publish ansible collections tarballs
environment:
ANSIBLE_CONFIG: "{{ ansible_config_file_path }}"
shell: "source ~/venv/bin/activate && ansible-galaxy -vvv collection publish {{ item.path }}"
with_items: "{{ collection_tarballs_files }}"
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ server_list = automation_hub
[galaxy_server.automation_hub]
url = https://cloud.redhat.com/api/automation-hub/
auth_url = https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token = {{ ansible_galaxy_info.token }}
client_id = {{ ansible_galaxy_info.client_id }}
client_secret = {{ ansible_galaxy_info.client_secret }}
14 changes: 0 additions & 14 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,6 @@
vars:
release_poetry_project: true

- job:
name: refresh-automation-hub-token
description: |
Nightly job to refresh our offline token for automation hub

See https://access.redhat.com/articles/3626371 for expire information.
final: true
run: playbooks/refresh-automation-hub-token/run.yaml
secrets:
- secret: ansible_automation_hub_secret
name: ansible_galaxy_info
nodeset:
nodes: []

- job:
name: release-ansible-collection-automation-hub
description: |
Expand Down
2 changes: 0 additions & 2 deletions zuul.d/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,9 @@
default-branch: master
check:
jobs:
- refresh-automation-hub-token
- validate-ansible-galaxy-token
periodic:
jobs:
- refresh-automation-hub-token
- validate-ansible-galaxy-token

- project:
Expand Down
43 changes: 22 additions & 21 deletions zuul.d/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3467,27 +3467,28 @@
- secret:
name: ansible_automation_hub_secret
data:
token: !encrypted/pkcs1-oaep
- lo8YBT8XyMypexb+MZRK/LLouvzNenNET0jORfZSVx+1qX+ssgdUxbvVtZQpxMR+Ue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k2pcI1RYHZlB48glfFrheGAkdYKtuWlA9S405rPAsXBszB6Sl
mY7rXW17xRpwNd/nSmvA1c9wm4H+48hklZJWuTDto/1V2ed63cpqK50OWcF4jOVN8B2JP
xK5jCaKwKKot0LhBD1fInMrd5pvHZQbgScjbQUJCkVkRMcwKQxekpzuAegAWujBW7uvow
5KXpGX89eaGMSDhXxkQ1KkGn/J1xlmQi7pJt6+vPvCP5jKJxWRDNyh4141aSkRJYx4NmH
inR+OYhI+WrJxSlj1+WF7CFxqtWGrkcYkSTyVPVQ3GEXvyu/v+dfGd5y2Qbh9Fg7Q6C4G
CsSDb4au2kVAZNdT0VwYY5LLkzHUnwjMLMs5MJe7QUngWivY03KE3vHKbX+fmXmTbemte
60CBlCTjwYhanRiSDpsLI2qAvOKaQN0xzwNOMgH3gXmbw9NBn7OP7EO5nSh7mSjLao5i3
w+tYDrhIDrn+1ny53KIvUacozg7HPzWbJZ07xxy5ZX0wquGxCp1TduYZk5Pa/f005iM7H
k54t5LgTn5ZIgXBck10Et7B9plYpis7BoCxw+/FuaGZnKtT7ace6UM34zFvnwU=


####github_proposal_bot####
Expand Down