Ansible : AWX : Add Job Templates2024/07/31 |
This is the basic configuration for Ansible AWX to run Ansible Playbooks. To run Playbooks on target Hosts on AWX, it needs to configure the following settings.
* Add inventories
To add job templates, configure like follows. This example is based on the environment that Git repository is set with HTTP access enabled for the Source Control. |
|
[1] | Create a Playbook on Source Control repository that you'd like to execute on target Hosts from AWX. If you set Git repository like this example, refer to follows as a way to create Playbooks. |
# create new # for example, touch a file [/tmp/helloworld.txt] with 644 on target Hosts # for [hosts] value, specify the group name you set on an inventory you added # ⇒ example [hosts] value below, that is the group name set on here of [6] --- - hosts: Ubuntu tasks: - name: Test Task file: path: /root/helloworld.txt state: touch owner: root group: root mode: 0644 # push to repository ubuntu@dlp:~/work/project01$ git add helloworld.yml ubuntu@dlp:~/work/project01$ git commit helloworld.yml -m "Initial Commit" ubuntu@dlp:~/work/project01$ git remote -v origin http://ubuntu@dlp.srv.world/git/project01.git (fetch) origin http://ubuntu@dlp.srv.world/git/project01.git (push)ubuntu@dlp:~/work/project01$ git push origin master |
[2] | When you create new Playbooks on the repository set as Source Control, it needs to sync them with AWX. Login to Ansible AWX Web and click [Projects] on the left pane and open the project you added, and then, click [Sync] button to import new Playbooks. |
[3] | Add job templates, Click [Templates] on the left pane. |
[4] | Click [Add] - [Add job template] on the right pane. |
[5] |
Input basic information for job template and click [Save] button to save.
|
[6] | After Saving template, that's OK if following screen is shown. |
[6] | After adding a job template, That's OK if template is displayed on [Templates] list. |
Sponsored Link |