1.9 KiB
1.9 KiB
Processing Steps for Creating Ansible Playbook
This document details the steps followed to create and manage the Ansible playbook for applying system updates.
-
Analyze Home Directory for Existing Git Repositories
- Used
find /home/grok -type d -name ".git"to list existing repositories. - Found: file-sorting-process, utility-scripts, ansible-inventories, cheatsheets.
- Used
-
Create a New Git Repository
- Decided on a new repository named 'ansible-playbooks' as no existing one was suitable for Ansible playbooks.
- Created the repository on Gitea using API:
curl -u <creds> -X POST http://10.10.10.254:3000/api/v1/user/repos -d '{"name": "ansible-playbooks"}'. - Locally:
mkdir ansible-playbooks,git -C ... init, added remotessh://git@127.0.0.1:2222/grok/ansible-playbooks.git.
-
Check and Install Tools
- Verified
yamllint,ansible-lint, andansibleare installed usingwhich. - All were already present; no installations needed.
- Verified
-
Create the Playbook File
- Created
/home/grok/ansible-playbooks/update-system.ymlwith content for updating Debian and RedHat-based systems. - Used
create_filetool.
- Created
-
Validate and Lint the Playbook
- Ran
yamllintand fixed 'yes' to 'true' usingstr_replace_editor. - Ran
ansible-lintand fixed by adding FQCN (e.g., ansible.builtin.apt) and '# noqa package-latest' for relevant tasks.
- Ran
-
Commit and Push to Gitea
- Renamed branch to 'main':
git branch -m master main. - Added file:
git add update-system.yml. - Committed:
git commit -m "Add update-system Ansible playbook for applying system updates". - Pushed:
git push origin main(after fixing remote URL for SSH port).
- Renamed branch to 'main':
-
Create This Steps File
- Created this
processing-steps.mdto document the process.
- Created this
-
Commit and Push Steps File
- Will commit and push this file to the repository.