Skip to content

totaldebug/ansible-collection-hassio_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Ansible collection containing modules for executing HA CLI Commands.

GitHub last commit GitHub issues GitHub pull requests

AboutFeaturesConfigurationContributingAuthorSupportDonateLicense


About

ansible-module-hassio is a high-quality Ansible Collection Module that executes HA CLI commands on your hassio ansible clients.

Hass.io is an operating system that will take care of installing and updating Home Assistant, is managed from the Home Assistant UI, allows creating/restoring snapshots of your configuration and can easily be extended using Hass.io add-ons including Google Assistant and Let’s Encrypt.

Features

🔰
Manage Hassio addons ✔️
Manage Hassio Host ✔️
Manage Hassio Snapshots ✔️
Manage Hassio DNS ✔️
Add / Remove Addon Repos ✔️

Configuration

Install

Include this collection as a requirement with your playbook.

ansible-galaxy collection install totaldebug.hassio_cli

Usage

hassio_addons

Option Required Description
name (alias: addon) True The name of the addon
state True The state of the addon ["present", "absent", "started", "stopped", "updated"]
Examples
# Install Samba share addon
- totaldebug.hassio_cli.hassio_addon:
    state: present
    name: core_samba

# Uninstall DHCP server and Grafana addons
- totaldebug.hassio_cli.hassio_addons:
    state: absent
    name: {{ item }}
  with_items:
    - core_dhcp_server
    - core_mosquitto

# Start Samba share addon
- totaldebug.hassio_cli.hassio_addons:
    state: started
    addon: core_samba

# Stop Samba share addon
- totaldebug.hassio_cli.hassio_addons:
    state: stopped
    name: core_samba

# Update Samba share addon
- totaldebug.hassio_cli.hassio_addons:
    state: updated
    name: core_samba

hassio_host

Option Required Description
state True ["rebooted", "updated", "shutdown"]
Examples
# Reboot HassIO OS
- totaldebug.hassio_cli.hassio_host:
    state: rebooted

# Update HassIO OS
- totaldebug.hassio_cli.hassio_host:
    state: updated

hassio_snapshot

Option Required Description
name False The name of the snapshot
state True ["new", "remove", "restore", "reload"]
Examples
# Create snapshot with name snap-10-01-2021
- totaldebug.hassio_cli.hassio_snapshot:
    state: new
    name: "snap-10-01-2021"

# Remove snapshot with name snap-10-01-2021
- totaldebug.hassio_cli.hassio_snapshot:
    state: remove
    name: "snap-10-01-2021"

# Restore snapshot with name snap-10-01-2021
- totaldebug.hassio_cli.hassio_snapshot:
    state: restore
    name: "snap-10-01-2021"

# Reload the files on disk to check for new or removed snapshots
- totaldebug.hassio_cli.hassio_snapshot:
    state: reload

hassio_addon_repos

Option Required Description
name (alias: repo) True The URL of the repo to be added
state True ["present", "absent"]
src False File where config is stored, Default: /usr/share/hassio/config.json
Examples
# Addrepo to config
- totaldebug.hassio_cli.hassio_addon_repos:
    state: present
    repo: "https://github.com/helto4real/hassio-add-ons"

# Remove repo from config
- totaldebug.hassio_cli.hassio_snapshot:
    state: absent
    repo: "https://github.com/helto4real/hassio-add-ons"
    src: "/usr/share/hassio/config.json"

Contributing

Got something interesting you'd like to share? Learn about contributing.

Versioning

This project follows semantic versioning.

In the context of semantic versioning, consider the role contract to be defined by the role variables.

  • Breaking Changes or changes that require user intervention will increase the major version. This includes changing the default value of a role variable.
  • Changes that do not require user intervention, but add new features, will increase the minor version.
  • Bug fixes will increase the patch version.

Author

TotalDebug
marksie1988 (Steven Marks)

Support

Reach out to me at one of the following places:

  • via Discord
  • Raise an issue in GitHub

Donate

Please consider supporting this project by sponsoring, or just donating a little via our sponsor page

License

License: CC BY-NC-SA 4.0