ce_config – Manage Huawei CloudEngine configuration sections¶
New in version 2.4.
Synopsis¶
- Huawei CloudEngine configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with CloudEngine configuration sections in a deterministic way. This module works with CLI transports.
Parameters¶
Notes¶
Note
- Recommended connection is
network_cli
. - This module also works with
local
connections for legacy playbooks.
Examples¶
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
- name: CloudEngine config test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Configure top level configuration and save it"
ce_config:
lines: sysname {{ inventory_hostname }}
save: yes
provider: "{{ cli }}"
- name: "Configure acl configuration and save it"
ce_config:
lines:
- rule 10 permit source 1.1.1.1 32
- rule 20 permit source 2.2.2.2 32
- rule 30 permit source 3.3.3.3 32
- rule 40 permit source 4.4.4.4 32
- rule 50 permit source 5.5.5.5 32
parents: acl 2000
before: undo acl 2000
match: exact
provider: "{{ cli }}"
- name: "Configure acl configuration and save it"
ce_config:
lines:
- rule 10 permit source 1.1.1.1 32
- rule 20 permit source 2.2.2.2 32
- rule 30 permit source 3.3.3.3 32
- rule 40 permit source 4.4.4.4 32
parents: acl 2000
before: undo acl 2000
replace: block
provider: "{{ cli }}"
- name: configurable backup path
ce_config:
lines: sysname {{ inventory_hostname }}
provider: "{{ cli }}"
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- QijunPan (@QijunPan)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.