Skip to content

Commit

Permalink
modified: collections/requirements.yml
Browse files Browse the repository at this point in the history
	modified:   group_vars/all/auth.yml
	new file:   group_vars/all/eda_credentials.yml
	new file:   group_vars/all/eda_decision_environments.yml
	new file:   group_vars/all/eda_projects.yml
	new file:   group_vars/all/eda_rulebook_activations.yml
	modified:   group_vars/all/job_templates.yml
	new file:   playbooks/eda_config.yml
  • Loading branch information
djdanielsson committed Apr 11, 2024
1 parent 3c20471 commit 58f18d6
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 4 deletions.
1 change: 1 addition & 0 deletions collections/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ collections:
# Commented out until CI/CD can get fixed
# - name: ansible.controller
- name: awx.awx
- name: infra.eda_configuration
...
14 changes: 10 additions & 4 deletions group_vars/all/auth.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# User may add controller auth creds to this file and encrypt it using `ansible-vault`
---
controller_hostname: "{{ controller_host | default(groups['automationcontroller'][0]) }}"
controller_hostname: "{{ controller_host | default(groups['automationcontroller'][0]) }}:{{ controller_port | default(443) }}"
controller_username: "{{ controller_user | default('admin') }}"
controller_password: "{{ controller_pass }}"
controller_validate_certs: false

ah_host: "{{ ah_hostname | default(groups['automationhub'][0]) }}"
ah_host: "{{ ah_hostname | default(groups['automationhub'][0]) }}:{{ ah_port | default(443) }}"
ah_username: "{{ ah_user | default('admin') }}"
ah_password: "{{ ah_pass }}"
ah_path_prefix: galaxy # this is for private automation hub
validate_certs: false
ah_path_prefix: 'galaxy' # this is for private automation hub
ah_verify_ssl: false
ah_validate_certs: false

ee_registry_username: "{{ ah_username }}"
ee_registry_password: "{{ ah_password }}"
ee_registry_dest: "{{ ah_host }}"

eda_hostname: "{{ eda_host | default(groups['automationedacontroller'][0]) | default(groups['automationeda'][0]) }}:{{ eda_port | default(443) }}"
eda_username: "{{ eda_user | default('admin') }}"
eda_password: "{{ eda_pass }}"
eda_validate_certs: false
...
8 changes: 8 additions & 0 deletions group_vars/all/eda_credentials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
eda_credentials:
- name: hub
description: private automation hub
credential_type: 'Container Registry'
username: "{{ ah_username }}"
secret: "{{ ah_password }}"
...
7 changes: 7 additions & 0 deletions group_vars/all/eda_decision_environments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
eda_decision_environments:
- name: minimal
description: my default decision environment
image_url: "{{ ah_host }}/de-minimal-rhel8"
credential: hub
...
10 changes: 10 additions & 0 deletions group_vars/all/eda_projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
eda_projects:
- name: eda
description: config as code eda
url: https://github.com/djdanielsson/eda.git
# credential: test_token
wait: true
interval: 10
sync: true
...
14 changes: 14 additions & 0 deletions group_vars/all/eda_rulebook_activations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
eda_rulebook_activations:
- name: gitea_hook
description: Hook to listen for changes in gitea
project: eda
rulebook: config_as_code.yml
decision_environment: minimal
# extra_vars:
# provider: github-local
# repo_url: https://github.com/ansible/ansible-rulebook.git
enabled: true
state: present
awx_token: aap
...
13 changes: 13 additions & 0 deletions group_vars/all/job_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ controller_templates_all:
- ah_token_user
- vault

- name: eda_config
project: config_as_code
job_type: run
playbook: playbooks/eda_config.yml
inventory: config_as_code
execution_environment: supported
concurrent_jobs_enabled: false
ask_variables_on_launch: true
limit: "{{ env }}"
verbosity: 0
credentials:
- vault

- name: build_execution_environments
project: config_as_code
job_type: run
Expand Down
33 changes: 33 additions & 0 deletions playbooks/eda_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Playbook to configure event driven ansible controller post installation
hosts: all
vars_files:
- "../vaults/{{ env }}.yml"
connection: local
tasks:
- name: Include credential role
ansible.builtin.include_role:
name: infra.eda_configuration.credential
when: eda_credentials is defined

- name: Include project role
ansible.builtin.include_role:
name: infra.eda_configuration.project
when: eda_projects is defined

- name: Include project_sync role
ansible.builtin.include_role:
name: infra.eda_configuration.project_sync
when: eda_projects is defined

- name: Include decision_environment role
ansible.builtin.include_role:
name: infra.eda_configuration.decision_environment
when: eda_decision_environments is defined

- name: Include rulebook_activation role
ansible.builtin.include_role:
name: infra.eda_configuration.rulebook_activation
when: eda_rulebook_activations is defined

...

0 comments on commit 58f18d6

Please sign in to comment.