文件操作 - snmp_info.yml
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3.12/site-packages/ansible_collections/wti/remote/playbooks/cpm_snmp/snmp_info.yml
编辑文件内容
# 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'] }}"
修改文件时间
将文件时间修改为当前时间的前一年
删除文件