Good morning all,
Im hoping some of you can assist here.
i have recently joined a new organisation, and they are running ansible to generate config for new sites/devices etc - GREAT
The ansible itself is linked in with other tools to pull information, i.e NetBox
the problem i have is that the person who created the scripts etc no longer works here, so i am trying to piece together the existing playbook.
this is what i have below:
File structure
├── ansible.cfg
├── complete_config
├── inventory_directory
│ ├── group_vars
│ │ ├── example-site.yaml
│ │ ├── xxxxxx.yaml
│ │ └── junos.yaml
│ ├── host
│ ├── host_vars
│ │ ├── devica-a.yaml
│ │ ├── devica-b.yaml
│ │ ├── xxxxx-srx.yaml
│ │ └── xxxxx-switch.yaml
│ └── hosts.yaml
├── ncg-ansible-templates
│ ├── Readme.md
│ ├── example-core-playbook.yaml
│ ├── example-inventory
│ │ ├── group_vars
│ │ │ ├── xxxxx.yaml
│ │ │ └── junos.yaml
│ │ ├── host_vars
│ │ │ ├── asw1.floor-gnd.xxxxx.sof69.gb.yaml
│ │ │ └── csrx1.floor-gnd.xxxxx.sof69.gb.yaml
│ │ └── hosts
│ ├── example-playbook.yaml
│ └── roles
│ └── full_config
│ └── templates
│ ├── xxxxx-playbook.yaml
│ ├── juniper-base-template-v2.j2
│ ├── srx-base-template-v1.j2
│ ├── srx-cluster-template-v1.j2
│ ├── srx-cluster-template-v2.j2
│ ├── srx-standalone-template-v1.j2
│ ├── switch-template-v1.j2
│ ├── switch-template-v2.j2
│ └── tenant-core-config-template.j2
└── netbox-provisioning
├── __pycache__
│ └── netbox_allocate.cpython-38.pyc
├── ncg_netbox.py
├── netbox_allocate.py
└── tests
├── conftest.py
├── docker
│ ├── API_key.txt
│ ├── configuration
│ │ ├── configuration.py
│ │ ├── gunicorn_config.py
│ │ └── ldap_config.py
│ ├── create-docker-env.sh
│ ├── docker-compose.yml
│ ├── initializers
│ │ ├── custom_fields.yml
│ │ ├── device_roles.yml
│ │ ├── device_types.yml
│ │ ├── devices.yml
│ │ ├── groups.yml
│ │ ├── manufacturers.yml
│ │ ├── platforms.yml
│ │ ├── rack_roles.yml
│ │ ├── racks.yml
│ │ ├── regions.yml
│ │ ├── sites.yml
│ │ └── users.yml
│ ├── netbox.env
│ ├── postgres.env
│ ├── pytest_dump.sql
│ ├── redis.env
danr@DESKTOP-QU70IHU:~$
│ ├── reports
│ │ └── devices.py.example
│ └── startup_scripts
│ ├── 000_users.py
│ ├── 010_groups.py
│ ├── 020_custom_fields.py
│ ├── 030_regions.py
│ ├── 040_sites.py
│ ├── 050_manufacturers.py
│ ├── 060_device_types.py
│ ├── 070_rack_roles.py
│ ├── 080_racks.py
│ ├── 090_device_roles.py
│ ├── 100_platforms.py
│ └── 110_devices.py
├── test_data.py
└── test_netbox.py
19 directories, 69 files
when i run the ansible-playbook <site name playbook>.yaml it completes, but nothing is generated or output (or am i being blind)
danr@DESKTOP-QU70IHU:~$ ansible-playbook /home/danr/ncg-ansible-templates/roles/full_config/templates/xxxxx-playbook.yaml
PLAY [Config generation playbook] **************************************************************************************************************************
TASK [Set destination directory] ***************************************************************************************************************************
ok: [device-a]
ok: [xxxxx-srx]
ok: [device-b]
ok: [xxxxx-switch]
PLAY RECAP *************************************************************************************************************************************************
device-a : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
device-b : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
xxxxx-srx : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
xxxxx-switch : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
danr@DESKTOP-QU70IHU:~$
my playbook currently has this -
- name: Config generation playbook
hosts: all
gather_facts: false
tasks:
- name: Set destination directory
set_fact:
dest_dir: ~/complete_config/
Any assistance would be great on this.
Many thanks
Dan
------------------------------
DAN RAWLINGS
------------------------------