Skip to content

Commit

Permalink
Merge pull request #4 from abirami-n/Updates_2.5
Browse files Browse the repository at this point in the history
Depcreate ansible_net_os_name and use ansible_network_os instead.
  • Loading branch information
skg-net authored May 9, 2018
2 parents 3a0c6a3 + 2227557 commit 922a93b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Installation
Role variables
--------------

- Role is abstracted using the *ansible_network_os*/ *ansible_net_os_name* variable that can take the dellos9 value
- Role is abstracted using the *ansible_network_os* variable that can take the dellos9 value
- If *dellos_cfg_generate* is set to true, the variable generates the role configuration commands in a file
- Any role variable with a corresponding state variable set to absent negates the configuration of that variable
- Setting an empty value for any variable negates the corresponding configuration
Expand Down Expand Up @@ -79,13 +79,13 @@ The *dellos-vrrp* role is built on modules included in the core Ansible code. Th
Example playbook
----------------

This example uses the *dellos-vrrp* role to configure VRRP commands at the interfaces. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the *ansible_network_os*/*ansible_net_os_name* variable with corresponding Dell EMC networking OS name.
This example uses the *dellos-vrrp* role to configure VRRP commands at the interfaces. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the *ansible_network_os* variable with corresponding Dell EMC networking OS name.

When *dellos_cfg_generate* is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *dellos-vrrp* role.

**Sample hosts file**

leaf1 ansible_host= <ip_address> ansible_net_os_name= <OS name(dellos9)>
leaf1 ansible_host= <ip_address>

**Sample host_vars/leaf1**

Expand Down
12 changes: 6 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@
template:
src: dellos9_vrrp.j2
dest: "{{ build_dir }}/vrrp9_{{hostname}}.conf.part"
when: (ansible_network_os == "dellos9" or ansible_net_os_name == "dellos9") and ((dellos_cfg_generate | default('False')) | bool)
when: (ansible_network_os is defined and ansible_network_os == "dellos9") and ((dellos_cfg_generate | default('False')) | bool)
# notify: save config os9
register: generate_output

- name: "Provisioning VRRP configuration for dellos9"
dellos9_config:
src: dellos9_vrrp.j2
when: (ansible_network_os == "dellos9" or ansible_net_os_name == "dellos9")
when: (ansible_network_os is defined and ansible_network_os == "dellos9")
# notify: save config os9
register: output

- name: "Generating VRRP configuration for dellos6"
template:
src: dellos6_vrrp.j2
dest: "{{ build_dir }}/vrrp6_{{hostname}}.conf.part"
when: (ansible_network_os == "dellos6" or ansible_net_os_name == "dellos6") and ((dellos_cfg_generate | default('False')) | bool)
when: (ansible_network_os is defined and ansible_network_os == "dellos6") and ((dellos_cfg_generate | default('False')) | bool)
# notify: save config os6
register: generate_output

- name: "Provisioning VRRP configuration for dellos6"
dellos6_config:
src: dellos6_vrrp.j2
when: (ansible_network_os == "dellos6" or ansible_net_os_name == "dellos6")
when: (ansible_network_os is defined and ansible_network_os == "dellos6")
# notify: save config os6
register: output

- name: "Generating VRRP configuration for dellos10"
template:
src: dellos10_vrrp.j2
dest: "{{ build_dir }}/vrrp10_{{hostname}}.conf.part"
when: (ansible_network_os == "dellos10" or ansible_net_os_name == "dellos10") and ((dellos_cfg_generate | default('False')) | bool)
when: (ansible_network_os is defined and ansible_network_os == "dellos10") and ((dellos_cfg_generate | default('False')) | bool)
# notify: save config os10
register: generate_output

- name: "Provisioning VRRP configuration for dellos10"
dellos10_config:
src: dellos10_vrrp.j2
when: (ansible_network_os == "dellos10" or ansible_net_os_name == "dellos10")
when: (ansible_network_os is defined and ansible_network_os == "dellos10")
# notify: save config os10
register: output

Expand Down

0 comments on commit 922a93b

Please sign in to comment.