watsonb / ar_olug_hello_world

Example role for OLUG meeting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ar_hello_world

Just a little "Hello World" role for testing purposes. Primarily used to test that AWX and other tools are able to successfully ansible-galaxy install this role and apply it.

Run with verbose output (i.e., -v) to debug the host's standard output.

Build Status

Branch Status
develop Build Status
master Build Status

Current Version

Version

See VERSION for notes/history.

Requirements

N/A

Role Variables

All over-writable variables used in this role are defined in defaults/main.yml.

You can override the variables in any standard Ansible-way (e.g. group_vars, host_vars, playbook variables, command-line, etc.).

The variables in this role include:

Name Required Default Choices Comments
hello_world_msg yes 'Hello, World!' The message to echo on a host
hello_world_verbosity yes 1 1,2,3,4,5 The verbosity level of debug messages
hello_world_changed no false true,false Whether the shell commands are "changed" and fire handler(s).

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Role Description Version

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- name: Role with defaults
  hosts: servers
  gather_facts: true
  tasks:

    - name: apply ar_hello_world role
      import_role:
        name: ar_hello_world
- name: Role with over-rides
  hosts: servers
  gather_facts: true
  tasks:

    - name: apply ar_hello_world role
      import_role:
        name: ar_hello_world
      vars:
        hello_world_msg: 'Goodbye, World!'

Note: Form (1) is preferred in playbooks as it keeps the playbooks reusable. Ideally, you should be over-riding variable values via group/host vars in an inventory.

Note: You must gather facts (gather_facts: true) for ansible_system to detect Windows vs. Linux hosts.

License

TBD

Author Information

Author E-mail
Ben Watson Benjamin.Watson@kiewit.com

Role Development Information

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Git SCM

Please refer to the .gitignore file and update accordingly depending on your development environment, etc. The particular file was generated at gitignore.io and contains settings for the following:

  • Ansible
  • Python
  • Vim
  • Eclipse
  • IntelliJ IDEA
  • Linux
  • Windows

Versioning

Please update VERSION.md as you release new versions of your role and try to abide by Semantic Versioning.

Self-contained

Please try to keep this role as self-contained as possible such that it may be simply installed (e.g. ansible-galaxy install) and applied as part of a playbook.

Documentation

This role leverages ansible-mdgen to generate "pretty" documentation for this role. As such, this role contains a mkdocs configuration at the root of the project folder and a docs/ sub-folder.

Please consult the ansible-mdgen documentation for advanced usage, but as a primer for getting started, do the following:

cd <path_to_root_of_role>
pip install -r docs/requirements.txt
ansible-mdgen .

# view your documentation live as you author role
mkdocs serve

# build your docs for distribution/hosting
# note, the resulting site/ folder is ignored via Python .gitignore rules
mkdocs build

About

Example role for OLUG meeting

License:GNU General Public License v2.0


Languages

Language:Python 90.5%Language:Jinja 8.1%Language:Shell 1.4%