GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - linux-system-roles/template: example template for creating new subsystem roles

BranchesTags
Open more actions menu

Latest commit

 

History

322 Commits
322 Commits

Folders and files

NameName
Last commit message
Last commit date
.fmf
.fmf
 
 
.github
.github
 
 
.ostree
.ostree
 
 
defaults
defaults
 
 
examples
examples
 
 
handlers
handlers
 
 
library
library
 
 
meta
meta
 
 
plans
plans
 
 
tasks
tasks
 
 
templates
templates
 
 
tests
tests
 
 
vars
vars
 
 
.ansible-lint
.ansible-lint
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.codespell_ignores
.codespell_ignores
 
 
.codespellrc
.codespellrc
 
 
.gitignore
.gitignore
 
 
.markdownlint.yaml
.markdownlint.yaml
 
 
.pandoc_template.html5
.pandoc_template.html5
 
 
.sanity-ansible-ignore-2.14.txt
.sanity-ansible-ignore-2.14.txt
 
 
.sanity-ansible-ignore-2.16.txt
.sanity-ansible-ignore-2.16.txt
 
 
.sanity-ansible-ignore-2.17.txt
.sanity-ansible-ignore-2.17.txt
 
 
.sanity-ansible-ignore-2.18.txt
.sanity-ansible-ignore-2.18.txt
 
 
.sanity-ansible-ignore-2.19.txt
.sanity-ansible-ignore-2.19.txt
 
 
.sanity-ansible-ignore-2.20.txt
.sanity-ansible-ignore-2.20.txt
 
 
.sanity-ansible-ignore-2.21.txt
.sanity-ansible-ignore-2.21.txt
 
 
.sanity-ansible-ignore-2.22.txt
.sanity-ansible-ignore-2.22.txt
 
 
.sanity-ansible-ignore-2.23.txt
.sanity-ansible-ignore-2.23.txt
 
 
.yamllint.yml
.yamllint.yml
 
 
LICENSE
LICENSE
 
 
README-ansible.md
README-ansible.md
 
 
README-ostree.md
README-ostree.md
 
 
README.md
README.md
 
 
contributing.md
contributing.md
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Role Name

citest.yml

template

A template for an ansible role that configures some GNU/Linux subsystem or service. A brief description of the role goes here.

Requirements

Any prerequisites that may not be covered by Ansible itself or the role should be mentioned here. This includes platform dependencies not managed by the role, hardware requirements, external collections, etc. There should be a distinction between control node requirements (like collections) and managed node requirements (like special hardware, platform provisioning).

Collection requirements

For instance, if the role depends on some collections and has a meta/collection-requirements.yml file for installing those dependencies, and in order to manage rpm-ostree systems, it should be mentioned here that the user should run

ansible-galaxy collection install -vv -r meta/collection-requirements.yml

on the control node before using the role.

Role Variables

Validation is enforced by meta/argument_specs.yml.

A description of all input variables (i.e. variables that are defined in defaults/main.yml) for the role should go here as these form an API of the role. Each variable should have its own section e.g.

template_foo

A string variable for the foo setting. The default value is "foo".

template_bar

A boolean variable that enables or disables the bar feature. The default value is true.

template_baz

An integer variable for a numeric setting. The default value is 0.

template_config_path

Filesystem path to the configuration file. The default value is "/etc/template.conf".

template_state

Desired state of the template subsystem. Must be one of enabled or disabled. The default value is "enabled".

template_packages

A list of package names (strings). The default value is [].

template_raw_value

A variable that accepts values of different types (e.g. a string or a list). The default value is "".

template_services

A list of service configurations. Each entry is a dictionary with the following keys:

Key Type Required Description
name str yes Name of the service.
type str no Type of the service. One of simple, forking, oneshot.
enabled bool no Whether the service should be enabled at boot.

The default value is [].

Variables that are not intended as input, like variables defined in vars/main.yml, variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) can be also mentioned here but keep in mind that as these are probably not part of the role API they may change during the lifetime.

Example of setting the variables:

template_foo: "oof"
template_bar: false
template_baz: 42
template_config_path: /etc/myapp/config.yml
template_state: disabled
template_packages:
  - vim
  - tmux
template_raw_value:
  - first
  - second
template_services:
  - name: httpd
    type: forking
    enabled: true
  - name: my-worker
    type: simple

Variables Exported by the Role

This section is optional. Some roles may export variables for playbooks to use later. These are analogous to "return values" in Ansible modules. For example, if a role performs some action that will require a system reboot, but the user wants to defer the reboot, the role might set a variable like template_reboot_needed: true that the playbook can use to reboot at a more convenient time.

Example:

template_reboot_needed

Default false - if true, this means a reboot is needed to apply the changes made by the role

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: Manage the template subsystem
  hosts: all
  vars:
    template_foo: "foo foo!"
    template_bar: false
    template_baz: 42
    template_state: disabled
    template_services:
      - name: httpd
        type: forking
        enabled: true
  roles:
    - linux-system-roles.template

More examples can be provided in the examples/ directory. These can be useful, especially for documentation.

rpm-ostree

See README-ostree.md

License

Whenever possible, please prefer MIT.

Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).

About

example template for creating new subsystem roles

linux-system-roles.github.io/template/

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

15 stars

Watchers

10 watching

Forks

21 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.