Setup dedicated repository for your ansible projects, which includes playbooks, roles, and inventories. You might want to have a structure like this:
.
├── .github/workflows
├── collections
│ └── requirements.txt
├── controller_configs
│ ├── all
│ ├── controller
│ ├── pah
│ └── eda
├── inventory.yml
└── controller_config.yml
This allows you to separate controller configurations for different environment life-cycles.
This is just the specs for my lab and really the minimum requirements to highlight Ansible Controller as Code.
This repo currently offers a playbook that will configure Ansible controllers based on variables defined in group_vars and/or configs directory.
-
Seed the required objects to support Controller as Code
-
Located in the configs/directory are the configs to configure credential, project, and template to keep Controller as Code in sync
-
-
Continuous configuration as code
-
Keeps Ansible controllers in sync with code via template webhook
-
-
Ensure inventory.yml has YOUR Ansible Controller host(s) defined
-
Create a GitHub repository secret that is passed during workflow
-
CONTROLLER_PASSWORD = secret should be the Admin password used to login to the controller GUI
-
TOKEN = RH API Token
-
Note
|
You can now check the Actions to watch/check the status of the deployment. |
This will create admin credential, and a project with template to get stats from the controller. To highlight the syncing ability from Git to Controller.