Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# ansible-playbook ./cpm_config_backup.yml -e ansible_hosts=nameofhost
- name: Get Device Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=False
when: use_https is undefined
- set_fact: validate_certs=False
when: validate_certs is undefined
- name: run Get Network Interface
cpm_config_backup:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,27 @@
# ansible-playbook ./cpm_config_restore.yml -e ansible_hosts=nameofhost
- name: Set Device Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=False
when: use_https is undefined
- set_fact: validate_certs=False
when: validate_certs is undefined
- name: run Set Device Parameters
cpm_config_restore:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
cpm_filename: "wti-192-10-10-239-2020-02-13T16-17-22-xml"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,29 @@
# ansible-playbook ./firmware_upgrade.yml
- name: Upgrade WTI Device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=False
when: use_https is undefined
- set_fact: validate_certs=False
when: validate_certs is undefined
- name: upgrade WTI device checking online for new version
cpm_firmware_update:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
cpm_path: "/tmp/"
# when cpm_file is missing, the playbook will look online for the latest version
# cpm_file: "uimage_3352_tsm_arm.md5"
# cpm_file: "uimage_3352_128512_vmr_v2.15.md5"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,28 @@
# ansible-playbook ./hostname_config.yml -e ansible_hosts=youransibledefinedhostnames
- name: Set Hostname (Site ID), Location, Asset Tag parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_hostname_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
hostname: "newhostname"
location: "newlocation"
assettag: "newassettag"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./hostname_info.yml -e ansible_hosts=youransibledefinedhostnames
- name: Get Hostname (Site ID), Location, Asset Tag parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_hostname_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,31 @@
# ansible-playbook ./interface_config.yml -e ansible_hosts=nameofhost
- name: Set Network Interface parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_interface_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "eth1"
ipv4netmask: "255.255.255.0"
ipv4gateway: "192.168.0.2"
ipv4address: "192.168.0.16"
negotiation: 0
ipv4dhcpenable: 0
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,26 @@
# ansible-playbook ./interface_info.yml -e ansible_hosts=nameofhost
- name: Get Network Interface parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_interface_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "eth0"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,35 @@
# ansible-playbook ./iptables_config.yml -e ansible_hosts=nameofhost
- name: Set Network IPTABLES parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_iptables_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
protocol: 0
index:
- 1
- 2
- 48
command:
- "iptables the passed in command 2.."
- "iptables the passed in command 4.."
- "iptables the passed in command 48."
clear: 0
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./iptables_info.yml -e ansible_hosts=nameofhost
- name: Get Network IPTABLES Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_iptables_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,32 @@
# ansible-playbook ./plug_config.yml -e ansible_hosts=nameofhost
- name: Set Plug Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Set Plug Parameters
cpm_plugconfig:
cpm_action: "setplugconfig"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
plug_id: "2" # plug 2 is being changed
plug_name: "plugname2"
plug_bootdelay: 1
plug_default: 0
plug_bootpriority: 99
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout }}"

View File

@@ -0,0 +1,28 @@
# ansible-playbook ./plug_info.yml -e ansible_hosts=nameofhost
- name: Get Plug Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Get Plug Parameters of plug 1
cpm_plugconfig:
cpm_action: "getplugconfig"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
plug_id: "1"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,30 @@
# ansible-playbook ./plug_control.yml -e ansible_hosts=nameofhost
- name: Control Plug State
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: Control the plug state
cpm_plugcontrol:
cpm_action: "setplugcontrol"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
plug_id: "2" # plug 2 is being changed
plug_state: "boot"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout }}"

View File

@@ -0,0 +1,28 @@
# ansible-playbook ./plug_control_info.yml -e ansible_hosts=nameofhost
- name: Get Plug Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Get Plug status of plug 1
cpm_plugcontrol:
cpm_action: "getplugcontrol"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
plug_id: "1"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,27 @@
# ansible-playbook ./serial_port_info.yml -e ansible_hosts=nameofhost
- name: Get Serial Port Connection/Disconnection state
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Get Serial Port Connection status of Ports 1, 2 and 3
cpm_serial_port_action_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
port: "1,2,3"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,29 @@
# ansible-playbook ./serial_ports_action_set.yml -e ansible_hosts=nameofhost
- name: Set Serial Port Connection/Disconnection state
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=False
when: validate_certs is undefined
- name: run Connect Serial Port 4 and 5 command
cpm_serial_port_action_set:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
port: 4
portremote: 5
action: 1
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,39 @@
# ansible-playbook ./serial_ports_config.yml -e ansible_hosts=nameofhost
- name: Set Serial Port Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Set Port Parameters of Port 4
cpm_serial_port_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
port: 4
baud: 4
portname: "Sam4"
handshake: 2
stopbits: 1
parity: 0
mode: 1
cmd: 0
seq: 1
tout: 1
echo: 0
break_allow: True
logoff: "^W"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,27 @@
# ansible-playbook ./serial_ports_info.yml -e ansible_hosts=nameofhost
- name: Get Serial Port Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Get Port Parameters of Ports 1, 2 and 3
cpm_serial_port_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
port: "1,2,3"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,54 @@
# ansible-playbook ./snmp_config.yml -e ansible_hosts=nameofhost
- name: Set Network SNMP Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Set interface parameters
cpm_snmp_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "eth0"
protocol: 0
clear: 0
enable: 0
readonly: 0
version: 2
index:
- 2
- 4
username:
- "username1b"
- "username3a"
authpass:
- "xxxxx1abc"
- "authpass3a"
privpass:
- "privpass2a"
- "privpass3a"
authpriv:
- 1
- 0
authproto:
- 0
- 0
privproto:
- 0
- 0
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,29 @@
# ansible-playbook ./snmp_info.yml -e ansible_hosts=nameofhost
- name: Get Network SNMP Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- set_fact: ansible_interface="eth0"
when: ansible_interface is undefined
- name: Run Get SNMP parameters
cpm_snmp_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "{{ansible_interface}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./alarm_info.yml -e ansible_hosts=yourhostname
- name: Get Alarm information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_alarm_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,27 @@
# ansible-playbook ./current_info.yml -e ansible_hosts=yourhostname
- name: Get Current information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_current_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
cpm_startdate: "02-02-2020"
cpm_enddate: "02-28-2020"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./firmware_info.yml -e ansible_hosts=yourhostname
- name: Get Firmware information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_firmware_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,27 @@
# ansible-playbook ./temp_info.yml -e ansible_hosts=yourhostname
- name: Get Power information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_power_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
cpm_startdate: "02-02-2020"
cpm_enddate: "02-28-2020"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./status_info.yml -e ansible_hosts=yourhostname
- name: Get Status information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_status_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./temp_info.yml -e ansible_hosts=yourhostname
- name: Get Temperature information from WTI device
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- wti.remote.cpm_temp_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,43 @@
# ansible-playbook ./syslog_client_config.yml -e ansible_hosts=nameofhost
- name: Set Network SYSLOG Client Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Set interface parameters
cpm_syslog_client_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
protocol: 0
clear: 1
index:
- 1
- 3
address:
- "11.22.33.44"
- "55.66.77.88"
port:
- 555
- 557
transport:
- 1
- 0
secure:
- 0
- 1
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,30 @@
# ansible-playbook ./syslog_client_info.yml -e ansible_hosts=nameofhost
- name: Get Network SYSLOG Client Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- set_fact: ansible_interface="eth0"
when: ansible_interface is undefined
- name: Run Get SYSLOG Server parameters
cpm_syslog_client_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "{{ansible_interface}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,40 @@
# ansible-playbook ./syslog_server_config.yml -e ansible_hosts=nameofhost
- name: Set Network SNMP Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Set interface parameters
cpm_syslog_server_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
interface: "eth0"
protocol: 0
clear: 1
enable: 1
port: 555
transport: 1
secure: 0
index:
- 1
- 3
address:
- "11.22.33.44"
- "55.66.77.88"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,30 @@
# ansible-playbook ./syslog_server_info.yml -e ansible_hosts=nameofhost
- name: Get Network SYSLOG Server Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- set_fact: ansible_interface="eth0"
when: ansible_interface is undefined
- name: Run Get SYSLOG Server parameters
cpm_syslog_server_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
interface: "{{ansible_interface}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,29 @@
# ansible-playbook ./time_config.yml -e ansible_hosts=nameofhost
- name: Set Time Date parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=False
when: use_https is undefined
- set_fact: validate_certs=False
when: validate_certs is undefined
- cpm_time_config:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
timezone: 5
ntpenable: 1
ipv4address: "time1.google.com,time2.google.com"
timeout: 4
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,25 @@
# ansible-playbook ./time_info.yml -e ansible_hosts=yourhostname
- name: Get Time/Date and NTP parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- cpm_time_info:
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,45 @@
# ansible-playbook ./user_add.yml -e ansible_hosts=nameofhost
- name: Add New User
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
vars_prompt:
- name: "user_name"
prompt: "Enter Username"
private: no
- name: "user_pass"
prompt: "Enter Password"
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Add New User
cpm_user:
cpm_action: "adduser"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
user_name: "{{user_name}}" # pass as -e user_name=sammy on the commandline
user_pass: "{{user_pass}}"
user_accesslevel: 1
user_accessserial: 0
user_accessapi: 1
user_accessweb: 0
user_accessoutbound: 1
user_accessssh: 1
user_portaccess: "10001110"
user_plugaccess: "11110000"
user_callbackphone: "9495551212"
use_https: "{{use_https}}"
validate_certs: "{{validate_certs}}"
register: output
- name: dump JSON output
debug:
msg: "{{ output.data }}"

View File

@@ -0,0 +1,33 @@
# ansible-playbook ./user_delete.yml -e ansible_hosts=nameofhost
- name: Delete Exiting User
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
vars_prompt:
- name: "user_name"
prompt: "Enter Username"
private: no
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Delete Exiting User
cpm_user:
cpm_action: "deleteuser"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
user_name: "{{user_name}}" # pass as -e user_name=sammy on the commandline
use_https: "{{use_https}}"
validate_certs: false
register: output
- name: dump JSON output
debug:
msg: "{{ output.data }}"

View File

@@ -0,0 +1,37 @@
# ansible-playbook ./user_edit.yml -e ansible_hosts=nameofhost
- name: Edit Exiting User
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
vars_prompt:
- name: "user_name"
prompt: "Enter Username"
private: no
- name: "user_pass"
prompt: "Enter Password"
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: Run Edit Existing User
cpm_user:
cpm_action: "edituser"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
user_name: "{{user_name}}" # pass as -e user_name=sammy on the commandline
user_pass: "{{user_pass}}" # pass as -e user_pass=sammy on the commandline
user_accesslevel: 3
use_https: "{{use_https}}"
validate_certs: false
register: testout
- name: dump test output
debug:
msg: "{{ testout['data'] }}"

View File

@@ -0,0 +1,33 @@
# ansible-playbook ./user_get.yml -e ansible_hosts=nameofhost
- name: Get User Parameters
hosts: "{{ansible_hosts}}" # pass as -e ansible_hosts=wti_demo on the commandline
collections:
- wti.remote
connection: local
gather_facts: False
vars_prompt:
- name: "user_name"
prompt: "Enter Username"
private: no
tasks:
- set_fact: use_https=True
when: use_https is undefined
- set_fact: validate_certs=True
when: validate_certs is undefined
- name: run Get User Parameters
cpm_user:
cpm_action: "getuser"
cpm_url: "{{ansible_host}}"
cpm_username: "{{ansible_user}}"
cpm_password: "{{ansible_pw}}"
user_name: "{{user_name}}" # pass as -e user_name=sammy on the commandline
use_https: "{{use_https}}"
validate_certs: false
register: output
- name: dump JSON output
debug:
msg: "{{ output.data }}"