Giter Site home page Giter Site logo

network-automation-cookbook's Introduction

Network-Automation-Cookbook

Network Automation Cookbook, published by Packt

Download a free PDF

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.

https://packt.link/free-ebook/9781789956481

network-automation-cookbook's People

Contributors

kokasha avatar packt-itservice avatar packtutkarshr avatar swathym14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

network-automation-cookbook's Issues

Missing parameter in roles/build_netbox_db/tasks/create_device_intf.yml

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.
image

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

create_device_intf

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.

Some Crucial mistakes ..

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

Gives an error when trying to run the playbook (pb_f5_onboard.yml) a second time.

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: Onboarding a New LTM
    hosts: ltm01
    connection: local
    tasks:
    • 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.

Captura de pantalla 2021-07-25 a la(s) 21 24 17

Why is this happening and how can I correct it?
Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.