Skip to content

nmstate/ansible-nmstate

Repository files navigation

Ansible Support for nmstate

Build Status Coverage Status Code Style: black

Ansible-Nmstate allows to configure the network state with Nmstate through Ansible.

Development Environment

Run unit tests:

tox

Installation

To install the modules, run:

make install

To install them system-wide, run this command as root. Alternatively the path to the module utils and the library can be specified on the command line:

ANSIBLE_MODULE_UTILS=$PWD/module_utils ansible -M $PWD/library ...

or for playbooks:

ANSIBLE_MODULE_UTILS=$PWD/module_utils ansible-playbook -M $PWD/library ...

Using aliases keeps the command-line shorter:

alias ansible="ANSIBLE_MODULE_UTILS=$PWD/module_utils ansible -M $PWD/library"
alias ansible-playbook="ANSIBLE_MODULE_UTILS=$PWD/module_utils ansible-playbook -M $PWD/library"

Another possiblity for testing is to install direnv to automatically activate the necessary environment when entering the repository.

Basic Operations

For example playbooks, see the playbooks/ directory. Run a playbook:

ansible-playbook playbooks/bond.yml -i rhel8-cloud,

Note, in order to run the above playbook, nmstate 0.4 or later version must be already installed on target machine.