network-automation / toolkit Goto Github PK
View Code? Open in Web Editor NEWAnsible Content Collection for common network functions like dynamic documentation
License: GNU General Public License v3.0
Ansible Content Collection for common network functions like dynamic documentation
License: GNU General Public License v3.0
Please add the ansible-lint github action with the "production" profile. :)
From the "Ansible Automation Platform 2 Networking Automation Workshop"
"Network-Report" Jobs (which calls playbooks/network_report_legacy.yml) fail to generate a report
Play Recap shows an error for the task:
TASK [../roles/build_report_container : Create HTML report] ********************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'dict object' has no attribute 'static_routes'. 'dict object' has no attribute 'static_routes'
fatal: [ansible-1]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'static_routes'. 'dict object' has no attribute 'static_routes'"}
Attach the Debug output for the execution
job_3.txt
When running the network_backup.yml playbook. we get the following error.
Identity added: /tmp/awx_5_sbu11i59/artifacts/5/ssh_key_data (/tmp/awx_5_sbu11i59/artifacts/5/ssh_key_data)
ERROR! couldn't resolve module/action 'awx.awx.tower_job_template'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/tmp/awx_5_sbu11i59/project/network_backup.yml': line 54, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: create restore job template
^ here
The playbook is here https://github.com/network-automation/toolkit/blob/master/network_backup.yml
Workshop Name: 9cvpk
When running playbooks/network_backup.yml
TASK [Create restore job template] *********************************************
fatal: [rtr2]: FAILED! => {"changed": false, "msg": "Failed to update survey: Field 'spec' is missing from survey spec."}
{
"msg": "Failed to update survey: Field 'spec' is missing from survey spec.",
"invocation": {
"module_args": {
"name": "Network Automation - Restore",
"job_type": "run",
"inventory": "Workshop Inventory",
"project": "Workshop Project",
"playbook": "playbooks/network_restore.yml",
"credential": "Workshop Credential",
"survey_enabled": true,
"survey_spec": {
"changed": true,
"backup_path": "/tmp/rtr2.txt",
"date": "2023-08-22",
"time": "20:06:27",
"failed": false
},
"validate_certs": false,
"execution_environment": "Default execution environment",
"controller_host": "student1.9cvpk.example.opentlc.com",
"controller_username": "admin",
"controller_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"controller_oauthtoken": "",
"verbosity": 0,
"force_handlers": false,
"timeout": 0,
"job_slice_count": 1,
"state": "present",
"controller_config_file": null,
"new_name": null,
"copy_from": null,
"description": null,
"organization": null,
"vault_credential": null,
"credentials": null,
"custom_virtualenv": null,
"instance_groups": null,
"forks": null,
"limit": null,
"extra_vars": null,
"job_tags": null,
"skip_tags": null,
"start_at_task": null,
"use_fact_cache": null,
"host_config_key": null,
"ask_diff_mode_on_launch": null,
"ask_variables_on_launch": null,
"ask_limit_on_launch": null,
"ask_tags_on_launch": null,
"ask_skip_tags_on_launch": null,
"ask_job_type_on_launch": null,
"ask_verbosity_on_launch": null,
"ask_inventory_on_launch": null,
"ask_credential_on_launch": null,
"ask_execution_environment_on_launch": null,
"ask_forks_on_launch": null,
"ask_instance_groups_on_launch": null,
"ask_job_slice_count_on_launch": null,
"ask_labels_on_launch": null,
"ask_timeout_on_launch": null,
"become_enabled": null,
"diff_mode": null,
"allow_simultaneous": null,
"scm_branch": null,
"ask_scm_branch_on_launch": null,
"webhook_service": null,
"webhook_credential": null,
"labels": null,
"notification_templates_started": null,
"notification_templates_success": null,
"notification_templates_error": null,
"prevent_instance_group_fallback": null
}
},
"_ansible_no_log": null,
"changed": false
}
Now I have
job_10661 (1).txt
at this point
TASK [../roles/build_report_container : Create HTML report] ********************
I took your code on creating a report and am trying to run it on my system, I have Cisco 9500's and all i really did was change the hosts to my 9500 and the other to one of my linux VMs that runs Rocky 8.8 I made sure it was setup with SELinux as well as podman, I run my PB from AAP and it throws an error at the TASK [../roles/build_report_container : "Create HTML report" and I have looked threw the code and cannot find any problems I would say I an and pretty good at Ansible and AAP but networking with this is new to me, anyhow I attached my output maybe you could point me in the right direction
job_10438.txt
I really appreciate your help with this
ERROR! couldn't resolve module/action 'ansible.controller.job_template'. This often indicates a misspelling, missing collection, or incorrect module path.
using network-workshop latest image.
The task Create a directory if it does not exist
has been failed because of there is no become: yes
option.
TASK [Create a directory if it does not exist] *
fatal: [rtr2 -> backup-server(54.169.134.223)]: FAILED! => {"changed": false, "msg": "There was an issue creating /backup as requested: [Errno 13] Permission denied: b'/backup'", "path": "/backup/"}
When I add become into the playbook, It worked without issue:
- name: Create a directory if it does not exist
ansible.builtin.file:
path: /backup/
state: directory
delegate_to: backup-server
run_once: true
become: yes
TASK [../roles/backup : backup junos configuration] ****************************
fatal: [rtr3]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: sudo: command not found\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}
This is from networking ex6 execution. When escalate priv is enabled, this error is shown
TASK [Create a directory if it does not exist] *********************************
fatal: [rtr2 -> backup-server(3.234.154.255)]: FAILED! => {"changed": false, "msg": "There was an issue creating /backup as requested: [Errno 13] Permission denied: b'/backup'", "path": "/backup/"}
Task code:
- name: Create a directory if it does not exist
ansible.builtin.file:
path: /backup/
state: directory
delegate_to: backup-server
run_once: true
This is from the network exercise 6 execution, I believe it is due to the absolute path, need to escalate privileges, which is not stated on the documentation.
In expectation of PR ansible/workshops#891 merging into the main workshops repo, any references to the control node should be updated to ansible-1
(network reports for instance).
I plan to update this issue with an associated PR once the cluster PR is merged into devel.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.