Files
ansible-playbooks/processing-steps.md

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.

  1. 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.
  2. 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 remote ssh://git@127.0.0.1:2222/grok/ansible-playbooks.git.
  3. Check and Install Tools

    • Verified yamllint, ansible-lint, and ansible are installed using which.
    • All were already present; no installations needed.
  4. Create the Playbook File

    • Created /home/grok/ansible-playbooks/update-system.yml with content for updating Debian and RedHat-based systems.
    • Used create_file tool.
  5. Validate and Lint the Playbook

    • Ran yamllint and fixed 'yes' to 'true' using str_replace_editor.
    • Ran ansible-lint and fixed by adding FQCN (e.g., ansible.builtin.apt) and '# noqa package-latest' for relevant tasks.
  6. 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).
  7. Create This Steps File

    • Created this processing-steps.md to document the process.
  8. Commit and Push Steps File

    • Will commit and push this file to the repository.