Skip to content

darkwizard242/ansible-role-hostctl

Repository files navigation

build-test release Ansible Role Maintainability Rating Reliability Rating Security Rating GitHub tag (latest SemVer) GitHub repo size

Ansible Role: hostctl

Role to install (by default) hostctl on Debian/Ubuntu and EL systems. hostctl is a tool that gives you more control over the use of your hosts file. You can have multiple profiles and switch them on/off as you need.

Requirements

None.

Role Variables

Available variables are listed below (located in defaults/main.yml):

Variables list:

hostctl_app: hostctl
hostctl_version: 1.1.4
hostctl_os: linux
hostctl_arch: 64-bit
hostctl_dl_url: https://github.com/guumaster/{{ hostctl_app }}/releases/download/v{{ hostctl_version }}/hostctl_{{ hostctl_version }}_{{ hostctl_os }}_{{ hostctl_arch }}.tar.gz
hostctl_bin_path: /usr/local/bin
hostctl_file_owner: root
hostctl_file_group: root
hostctl_file_permission_mode: '0755'

Variables table:

Variable Description
hostctl_app Defines the app to install i.e. hostctl
hostctl_version Defined to dynamically fetch the desired version to install. Defaults to: 1.1.4
hostctl_os Defines os type. Defaults to: linux
hostctl_arch Defines os architecture. Defaults to: 64-bit
hostctl_dl_url Defines URL to download the hostctl binary from.
hostctl_bin_path Defined to dynamically set the appropriate path to store hostctl binary into. Defaults to (as generally available on any user's PATH): /usr/local/bin
hostctl_file_owner Owner for the binary file of hostctl.
hostctl_file_group Group for the binary file of hostctl.
hostctl_file_permission_mode Defines the permission mode level for the file. Defaults to: 0755

Dependencies

None

Example Playbook

For default behaviour of role (i.e. installation of hostctl) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.hostctl

For customizing behavior of role (i.e. specifying the desired hostctl version) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.hostctl
  vars:
    hostctl_version: 1.1.2

For customizing behavior of role (i.e. placing binary of hostctl package in different location) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.hostctl
  vars:
    hostctl_bin_path: /bin/

License

MIT

Author Information

This role was created by Ali Muhammad.