Skip to content

Commit

Permalink
Deprecate ansible_net_os_name and use ansible_network_os instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
abirami-n authored and skg-net committed May 9, 2018
1 parent b4ecf91 commit e4f8b81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 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 dellos9, dellos6, and dellos10 values
- Role is abstracted using the *ansible_network_os* variable that can take dellos9, dellos6, and dellos10 values
- If variable *dellos_cfg_generate* is set to true, it generates the role configuration commands in a file
- Any role variable with a corresponding state variable setting to absent negates the configuration of that variable
- Setting an empty value for any variable negates the corresponding configuration
Expand Down Expand Up @@ -149,7 +149,7 @@ When *dellos_cfg_generate* is set to true, the variable generates the configurat

**Sample hosts file**

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

**Sample host_vars/leaf1**

Expand Down
14 changes: 6 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,43 @@
template:
src: dellos9_bgp.j2
dest: "{{ build_dir }}/bgp9_{{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 BGP configuration for dellos9"
dellos9_config:
src: dellos9_bgp.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 BGP configuration for dellos6"
template:
src: dellos6_bgp.j2
dest: "{{ build_dir }}/bgp6_{{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 BGP configuration for dellos6"
dellos6_config:
src: dellos6_bgp.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 BGP configuration for dellos10"
template:
src: dellos10_bgp.j2
dest: "{{ build_dir }}/bgp10_{{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 BGP configuration for dellos10"
dellos10_config:
src: dellos10_bgp.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


0 comments on commit e4f8b81

Please sign in to comment.