Skip to content

Custom local.yml playbook and requirements file used to configure my personal system. Used in conjunction with duct-tape repository

Notifications You must be signed in to change notification settings

WhaleJ84/ansible-pull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 

Repository files navigation

Ansible Pull

Custom local.yml playbook and requirements file used to configure my personal system. Used in conjunction with duct-tape repository

WARNING: Unless you are me, do not run any of the code you see here. This repository is only public for my own convenience reasons. Code within can be unstable at any moment and is not tested on any systems other than my own. You have been warned.

Requirements

Any requirements should be automatically installed by running duct-tape linked above. When developing and testing locally, the latest requirements can be pulled via ansible-galaxy install -r requirements.yml $TARGET --force.

Usage

After successful completion of duct-tape, it will prompt you to run ansible-pull -KU https://github.com/WhaleJ84/ansible-pull.git. If 'local.yml' has been downloaded locally, it can be ran via ansible-playbook -K local.yml. To run specific roles in the playbook, you can filter them using tags. For example, --tags firefox --skip-tags install will only configure Firefox (not install) and not run any other roles.

Related Repositories

Personal Ansible role repositories related to this project will be linked here:

Development Notes

Any development notes relevant to this repository or any related ansible role repository will be kept here.

Tags

Tags are catorised into the following sections:

  • Shared
  • Role Specific

Shared

Shared tags used in playbooks should be documented here. Shared tags are used in all playbooks and should not be specific to a single role and therefore should be condisidered as reliable for filtering. The below shared tags can be used inconjuction with --skip-tags to fine-tune operation:

  • install
  • configure

Role Specific

Role specific tags are used to denote sections that are only applicable to their respective role. For example, whalej84.example should have a tag of example (omitting everything before the first full-stop).

Used in conjunction with shared tags, operation can be specified for areas of interest. For example, if only the whalej84.example role needed to be configured but not installed, --tags example --skip-tags install would do just that. This would rely on only the install and configure shared tags existing. If more tags existed, you would need to ignore all irrelevant tags. It should follow a structure of --tags $ROLE_SPECIFIC --skip-tags $SHARED.

Git Hooks

  • pre-commit
    • Lint and syntax check code (requires pip modules: yamllint ansible-lint).
#!/bin/sh

yamllint . || exit 1
ansible-playbook local.yml --syntax-check || exit 1
ansible-lint . || exit 1

Ansible Facts

Gather facts on the relevant local systems using ansible localhost -m ansible.builtin.setup.

Using local roles

To prevent requiring pushing changes to the remote role repo after every change and redownloading the role, a simpler method exists. Create a local environment variable called ANSIBLE_ROLES_PATH and point it to the directory where the roles exist. Ensure the directory names within match the role names in the playbooks, and they will take priority over the downloaded counterparts.

About

Custom local.yml playbook and requirements file used to configure my personal system. Used in conjunction with duct-tape repository

Resources

Stars

Watchers

Forks