Network Automation Cookbook, published by Packt
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.
Network Automation Cookbook, published by Packt
License: MIT License
Network Automation Cookbook, published by Packt
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.
Hi,
When trying to execute pb_build_netbox_db.yml I got an error in:
TASK [build_netbox_db : Create Managment Interfaces on Devices] ******************
failed: [dc1-spine01] (item={'key': 'port', 'value': 'Management1'}) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "port", "value": "Management1"}, "msg": {"type": ["This field is required."]}}
And this is because it looks like when creating Interfaces, a "type" must be input.
I fixed this error checking the interfaces in:
https://github.com/lampwins/netbox/blob/a21da27a1ecb5bc80f1b771462ffae3c3dec2429/netbox/dcim/constants.py#L53
and
lampwins/netbox@a21da27#diff-9163936a1babba6f51c3f4a0a91718eeR18
And adding a type:0 (for testing purposes using IFACE_FF_VIRTUAL = 0) on each Play
My question is, how is the best approach to fix it in order to run this project smoothly?
Do you think convenient if type:0 can be added for this project on each Play inside create_device_intf.yml?
Thank you.
the code have some mistakes that cause playbooks to fail
for example ch02/pb_gather_ssh_keys.yml
{{ ansibe_host }} should be {{ hostname }} according to the inventory
Trying to add a user to an F5 bigip with Ansible:
This is my config:
ubuntu1@alicantunez:~/f5_ansible$ cat hosts
[ltm]
ltm01 Ansible_host=10.10.10.136
ubuntu1@alicantunez:~/f5_ansible$ cat group_vars/all.yml
conn_parameters:
user: admin
password: alic2121.
server: "{{ Ansible_host }}"
server_port: 443
validate_certs: no
admin_passwd: NewP@sswd
users:
- name: Ansible
passwd: Ansible123
role: all:admin
state: present
ubuntu1@alicantunez:~/f5_ansible$ cat ansible.cfg
[defaults]
inventory=hosts
retry_files_enabled=False
gathering=explicit
host_key_checking=False
ubuntu1@alicantunez:~/f5_ansible$ cat pb_f5_onboard.yml
name: "P1T1: Create new Users"
bigip_user:
username_credential: "{{ item.name }}"
password_credential: "{{ item.passwd }}"
partition_access: "{{ item.role }}"
state: "{{ item.state | default('present')}}"
provider: "{{ conn_parameters }}"
loop: "{{ users }}"
name: "P1T1: Update admin Password"
bigip_user:
username_credential: admin
password_credential: "{{ admin_passwd }}"
state: present
provider: "{{ conn_parameters }}"
The first time I run the playbook the result is successful:
ubuntu1@alicantunez:~/f5_ansible$ ansible-playbook pb_f5_onboard.yml
PLAY [Onboarding a New LTM] **********************************************************************************************************************************
TASK [P1T1: Create new Users] ********************************************************************************************************************************
changed: [ltm01] => (item={'name': 'Ansible', 'passwd': 'Ansible123', 'role': 'all:admin', 'state': 'present'})
[WARNING]: Module did not set no_log for update_password
TASK [P1T1: Update admin Password] ***************************************************************************************************************************
changed: [ltm01]
PLAY RECAP ***************************************************************************************************************************************************
ltm01 : ok=2 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
But when I try to run it a second time (having deleted the user from the first run), I get the following error.
Why is this happening and how can I correct it?
Thanks in advance
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.