Ansible is a fantastic configuration management system that I use to self-provision servers & VMs. Currently I have Ansible run itself locally on a server during provisioning/bootstrapping only, but I have plans to also have Ansible update itself (by pulling this repo) and running against localhost periodically using Cron.
- scp private SSH key into ~/.ssh/
- grab bootstrap.sh
curl https://raw.githubusercontent.com/toozej/ansible/master/bootstrap.sh -O && chmod +x bootstrap.sh
- check the playbook: sudo ./bootstrap.sh -c $playbook_name.yml
- run the playbook: sudo ./bootstrap.sh -r $playbook_name.yml
Or if you would rather just automatically run the common playbook as a minimal install:
curl https://raw.githubusercontent.com/toozej/ansible/master/minimal.sh -O && chmod +x minimal.sh && ./minimal.sh
Or if you would rather just run one playbook stand-alone:
- cd /tmp/ansible; ansible-playbook $playbook_name.yml
Or if you want to run a playbook stand-alone skipping tags:
- cd /tmp/ansible; ansible-playbook $playbook_name.yml --skip-tags $tag_name,$tag_name2
Or if you want to run a playbook straight from the repo directory:
sudo ANSIBLE_ROLES_PATH=/home/james/src/github/toozej/ansible/roles ansible-playbook playbooks/simplenote-only.yml
- get localhost facts:
sudo ansible localhost -m setup
Ansible Porting Guides - validate Jenkinsfile using:
curl --user username:password -X POST -F "jenkinsfile=<Jenkinsfile" https://jenkins.example.com/pipeline-model-converter/validate
- GitHub Actions CI workflow based heavily off https://github.com/geerlingguy/ansible-role-firewall/blob/master/.github/workflows/ci.yml
- OS Distrubtion matrix from https://github.community/t/create-matrix-with-multiple-os-and-env-for-each-one/16895/6
From the root of this repo, run the following commands:
sudo pip install pre-commit
pre-commit install
pre-commit autoupdate
- commit any changes made, and ensure that pre-commit functions as expected
- push like usual