diff --git a/collections/requirements.yml b/collections/requirements.yml index ddac692..ecdf3de 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -8,4 +8,5 @@ collections: # Commented out until CI/CD can get fixed # - name: ansible.controller - name: awx.awx + - name: infra.eda_configuration ... diff --git a/group_vars/all/auth.yml b/group_vars/all/auth.yml index 01c1790..6c8c3bf 100644 --- a/group_vars/all/auth.yml +++ b/group_vars/all/auth.yml @@ -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 ... diff --git a/group_vars/all/eda_credentials.yml b/group_vars/all/eda_credentials.yml new file mode 100644 index 0000000..2e80b61 --- /dev/null +++ b/group_vars/all/eda_credentials.yml @@ -0,0 +1,8 @@ +--- +eda_credentials: + - name: hub + description: private automation hub + credential_type: 'Container Registry' + username: "{{ ah_username }}" + secret: "{{ ah_password }}" +... diff --git a/group_vars/all/eda_decision_environments.yml b/group_vars/all/eda_decision_environments.yml new file mode 100644 index 0000000..7190093 --- /dev/null +++ b/group_vars/all/eda_decision_environments.yml @@ -0,0 +1,7 @@ +--- +eda_decision_environments: + - name: minimal + description: my default decision environment + image_url: "{{ ah_host }}/de-minimal-rhel8" + credential: hub +... diff --git a/group_vars/all/eda_projects.yml b/group_vars/all/eda_projects.yml new file mode 100644 index 0000000..8efec44 --- /dev/null +++ b/group_vars/all/eda_projects.yml @@ -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 +... diff --git a/group_vars/all/eda_rulebook_activations.yml b/group_vars/all/eda_rulebook_activations.yml new file mode 100644 index 0000000..92f5784 --- /dev/null +++ b/group_vars/all/eda_rulebook_activations.yml @@ -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 +... diff --git a/group_vars/all/job_templates.yml b/group_vars/all/job_templates.yml index b61f2b1..acd3fd6 100644 --- a/group_vars/all/job_templates.yml +++ b/group_vars/all/job_templates.yml @@ -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 diff --git a/playbooks/eda_config.yml b/playbooks/eda_config.yml new file mode 100644 index 0000000..3ce9b3d --- /dev/null +++ b/playbooks/eda_config.yml @@ -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 + +...