Skip to content

Instantly share code, notes, and snippets.

@NilashishC
Last active November 5, 2024 08:33
Show Gist options
  • Save NilashishC/c3f9cec52fe8d1743b7da54c2c909ab6 to your computer and use it in GitHub Desktop.
Save NilashishC/c3f9cec52fe8d1743b7da54c2c909ab6 to your computer and use it in GitHub Desktop.
---
- name: Instruqt AAP Setup
hosts: localhost
become: false
gather_facts: false
collections:
- ansible.controller
vars:
controller_host: localhost
controller_user: admin
controller_pass: ansible123!
inventory_name: Autocon2-Inventory
credentials_name: cat8000v-credential
tasks:
- name: (EXECUTION) Create machine Credentials for the lab
ansible.controller.credential:
validate_certs: false
controller_username: admin
controller_password: ansible123!
name: cat8000v-credential
credential_type: Machine
organization: Default
inputs:
username: admin
ssh_key_data: "{{ lookup('file', '/home/rhel/.ssh/id_ed25519' ) }}"
- name: (EXECUTION) Create new execution environment
ansible.controller.execution_environment:
validate_certs: false
controller_username: admin
controller_password: ansible123!
name: network-ee
image: ghcr.io/ansible-network/autocon-ee:latest
pull: missing
- name: Debug SANDBOX_ID
ansible.builtin.debug:
msg: "https://control.{{ SANDBOX_ID }}.instruqt.io/api/controller/"
vars:
SANDBOX_ID: "{{ lookup('env', '_SANDBOX_ID') | default('SANDBOX_ID_NOT_FOUND', true) }}"
- name: (DECISIONS) Create an AAP Credential
ansible.eda.credential:
name: "AAP"
description: "To execute jobs from EDA"
inputs:
host: "https://control.{{ SANDBOX_ID }}.instruqt.io/api/controller/"
username: "admin"
password: "ansible123!"
credential_type_name: "Red Hat Ansible Automation Platform"
controller_host: "https://control.{{ SANDBOX_ID }}.instruqt.io"
controller_username: admin
controller_password: ansible123!
validate_certs: false
organization_name: Default
vars:
SANDBOX_ID: "{{ lookup('env', '_SANDBOX_ID') | default('SANDBOX_ID_NOT_FOUND', true) }}"
- name: (DECISIONS) Create a new DE
ansible.eda.decision_environment:
controller_host: "https://control.{{ SANDBOX_ID }}.instruqt.io"
controller_username: admin
controller_password: ansible123!
validate_certs: false
organization_name: Default
name: "Autocon2 Decision Environment"
description: "Decision Environment for Autocon2 AAP workshop"
image_url: "ghcr.io/ansible-network/autocon-de:latest"
vars:
SANDBOX_ID: "{{ lookup('env', '_SANDBOX_ID') | default('SANDBOX_ID_NOT_FOUND', true) }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment