- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Ansible Playbook for BloxOne Cloud
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2022 03:35 PM
Hello All,
I am a newbie to Bloxone environmemt. I need to write an Ansible Playbook to configure DHCP scopes in BloxOne. I am facing some issue get Ansible work with BloxOne.
--- - hosts: localhost connection: local gather_facts: false collections: - infoblox.b1ddi_modules tasks: # Test - name: Test b1_ipam_ip_space_gather: host: "csp.infoblox.com" api_key: "xxxxxxxx" state: gather register: ip_spaces_id
This is a test playbook that I am using and it errors out when I run it.
user @@ ~/user$ ansible-playbook bloxone.yml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' Executing playbook bloxone.yml - localhost on hosts: localhost - Gather Address block... An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: /api/ddi/v1/ipam/ip_space localhost failed | msg: MODULE FAILURE See stdout/stderr for the exact error - Play recap - localhost : ok=0 changed=0 unreachable=0 failed=1 rescued=0 ignored=0
Can anyone please help me to figured out the issue here?
Solved! Go to Solution.
Re: Ansible Playbook for BloxOne Cloud
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:19 PM
Any help would be appreciated!
Re: Ansible Playbook for BloxOne Cloud
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 11:34 PM
Hey,
The reason you may be getting this error is because you have mentioned the host as 'csp.infoblox.com'. You can try and change it to 'https://csp.infoblox.com' and try running it.
You can also modify the below script as per your needs to create Subnets and Ranges in an IP Space
--- - hosts: localhost connection: local collections: - infoblox.b1ddi_modules vars: - host: "https://csp.infoblox.com" - api: "xxxxxx" tasks: # Create a given IP space - name: Create IP space b1_ipam_ip_space: name: "Test-Ansible-Space" tags: - "Org": "Infoblox" - "Dept": "TME" comment: "This is a test IPSpace" host: "{{ host }}" api_key: "{{ api }}" state: present # Create a Subnet in a given IP space - name: Create Subnet in a given IP Space b1_ipam_subnet: space: "Test-Ansible-Space" address: '172.16.0.0/24' name: "Test-Ansible-Subnet1" comment: "This is the test subnet" api_key: "{{ api }}" host: "{{ host }}" state: present # Create a Range in a given subnet - name: Create Range in a given IP Space b1_ipam_range: space: "Test-Ansible-Space" name: "Test-Ansible-Range1" start: "172.16.0.100" end: "172.16.0.200" comment: "This is the test range" api_key: "{{ api }}" host: "{{ host }}" state: present
Regards,
Shukran
Re: Ansible Playbook for BloxOne Cloud
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 03:38 PM
Hello Shukran,
It worked! One follow up question. Do you know how to add default gateway option to the a subnet using the Playbook?
Re: Ansible Playbook for BloxOne Cloud
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 08:40 AM
I don't think that option is available in Ansible module. You can do it using API.
You can set the DHCP options by passing them in the request body.