community.network.ig_config module – Manage the configuration database on an Ingate SBC.
Note
This module is part of the community.network collection (version 5.0.3).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.network
. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: community.network.ig_config
.
Synopsis
- Manage the configuration database on an Ingate SBC.
Aliases: network.ingate.ig_config
Requirements
The below requirements are needed on the host that executes this module.
- ingatesdk >= 1.0.6
Parameters
Parameter | Comments |
---|---|
add boolean | Add a row to a table. Choices:
|
client string | A dict object containing connection details. |
address string / required |
The hostname or IP address to the unit. |
password string / required |
The password for the REST API user. |
port integer |
Which HTTP(S) port to connect to. |
scheme string / required |
Which HTTP protocol to use. Choices:
|
timeout integer |
The timeout (in seconds) for REST API requests. |
username string / required |
The username of the REST API user. |
validate_certs aliases: verify_ssl boolean |
Verify the unit’s HTTPS certificate. Choices:
|
version string |
REST API version. Choices:
|
columns string | A dict containing column names/values. |
delete boolean | Delete all rows in a table or a specific row. Choices:
|
download boolean | Download the configuration database from the unit. Choices:
|
factory boolean | Reset the preliminary configuration to its factory defaults. Choices:
|
filename string | The name of the file to store the downloaded configuration in. Refer to the |
get boolean | Return all rows in a table or a specific row. Choices:
|
modify boolean | Modify a row in a table. Choices:
|
no_response boolean | Expect no response when storing the preliminary configuration. Refer to the Choices:
|
path string | Where in the filesystem to store the downloaded configuration. Refer to the |
return_rowid boolean | Get rowid(s) from a table where the columns match. Choices:
|
revert boolean | Reset the preliminary configuration. Choices:
|
rowid integer | A row id. |
store boolean | Store the preliminary configuration. Choices:
|
store_download boolean | If the downloaded configuration should be stored on disk. Refer to the Choices:
|
table string | The name of the table. |
Notes
Note
- If
store_download
is set to True, andpath
andfilename
is omitted, the file will be stored in the current directory with an automatic filename. - This module requires that the Ingate Python SDK is installed on the host. To install the SDK use the pip command from your shell
pip install ingatesdk
.
Examples
- name: Add/remove DNS servers hosts: 192.168.1.1 connection: local vars: client_rw: version: v1 address: "{{ inventory_hostname }}" scheme: http username: alice password: foobar tasks: - name: Load factory defaults community.network.ig_config: client: "{{ client_rw }}" factory: true register: result - ansible.builtin.debug: var: result - name: Revert to last known applied configuration community.network.ig_config: client: "{{ client_rw }}" revert: true register: result - ansible.builtin.debug: var: result - name: Change the unit name community.network.ig_config: client: "{{ client_rw }}" modify: true table: misc.unitname columns: unitname: "Test Ansible" register: result - ansible.builtin.debug: var: result - name: Add a DNS server community.network.ig_config: client: "{{ client_rw }}" add: true table: misc.dns_servers columns: server: 192.168.1.21 register: result - ansible.builtin.debug: var: result - name: Add a DNS server community.network.ig_config: client: "{{ client_rw }}" add: true table: misc.dns_servers columns: server: 192.168.1.22 register: result - ansible.builtin.debug: var: result - name: Add a DNS server community.network.ig_config: client: "{{ client_rw }}" add: true table: misc.dns_servers columns: server: 192.168.1.23 register: last_dns - ansible.builtin.debug: var: last_dns - name: Modify the last added DNS server community.network.ig_config: client: "{{ client_rw }}" modify: true table: misc.dns_servers rowid: "{{ last_dns['add'][0]['id'] }}" columns: server: 192.168.1.24 register: result - ansible.builtin.debug: var: result - name: Return the last added DNS server community.network.ig_config: client: "{{ client_rw }}" get: true table: misc.dns_servers rowid: "{{ last_dns['add'][0]['id'] }}" register: result - ansible.builtin.debug: var: result - name: Remove last added DNS server community.network.ig_config: client: "{{ client_rw }}" delete: true table: misc.dns_servers rowid: "{{ last_dns['add'][0]['id'] }}" register: result - ansible.builtin.debug: var: result - name: Return the all rows from table misc.dns_servers community.network.ig_config: client: "{{ client_rw }}" get: true table: misc.dns_servers register: result - ansible.builtin.debug: var: result - name: Remove remaining DNS servers community.network.ig_config: client: "{{ client_rw }}" delete: true table: misc.dns_servers register: result - ansible.builtin.debug: var: result - name: Get rowid for interface eth0 community.network.ig_config: client: "{{ client_rw }}" return_rowid: true table: network.local_nets columns: interface: eth0 register: result - ansible.builtin.debug: var: result - name: Store the preliminary configuration community.network.ig_config: client: "{{ client_rw }}" store: true register: result - ansible.builtin.debug: var: result - name: Do backup of the configuration database community.network.ig_config: client: "{{ client_rw }}" download: true store_download: true register: result - ansible.builtin.debug: var: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
---|---|
add complex | A list containing information about the added row Returned: when |
data complex |
Column names/values Returned: success Sample: |
href string |
The REST API URL to the added row Returned: success Sample: |
id integer |
The row id Returned: success Sample: |
delete complex | A list containing information about the deleted row(s) Returned: when |
data complex |
Column names/values Returned: success Sample: |
id integer |
The row id Returned: success Sample: |
table string |
The name of the table Returned: success Sample: |
download complex | Configuration database and meta data Returned: when |
config string |
The configuration database Returned: success |
filename string |
A suggested name for the configuration Returned: success Sample: |
mimetype string |
The mimetype Returned: success Sample: |
factory complex | A command status message Returned: when |
msg string |
The command status message Returned: success Sample: |
get complex | A list containing information about the row(s) Returned: when |
data complex |
Column names/values Returned: success Sample: |
href string |
The REST API URL to the row Returned: success Sample: |
id integer |
The row id Returned: success Sample: |
table string |
The name of the table Returned: success Sample: |
modify complex | A list containing information about the modified row Returned: when |
data complex |
Column names/values Returned: success Sample: |
href string |
The REST API URL to the modified row Returned: success Sample: |
id integer |
The row id Returned: success Sample: |
table string |
The name of the table Returned: success Sample: |
return_rowid list / elements=string | The matched row id(s). Returned: when Sample: |
revert complex | A command status message Returned: when |
msg string |
The command status message Returned: success Sample: |
store complex | A command status message Returned: when |
msg string |
The command status message Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/ig_config_module.html