summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-06-08 05:27:36 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-06-08 05:27:36 +0200
commit0c94b5e9a5bca4f01621be7b0792c16adb7b15f2 (patch)
tree3486c9e7dbb830d2a5ecc7ea939a4e64d69f1677
parentMerge branch 'no-more-with' (diff)
initial support for dellos6 switches
-rw-r--r--chaos-at-home/ch-sw0.yml6
-rw-r--r--chaos-at-home/group_vars/chaos_at_home_switches.yml8
-rw-r--r--inventory/group_vars/dellos6/main.yml6
-rw-r--r--inventory/hosts.ini13
-rw-r--r--roles/dellos6/bootstrap/tasks/main.yml14
-rw-r--r--roles/dellos6/bootstrap/templates/init.j227
-rw-r--r--roles/dellos6/docs.url1
7 files changed, 74 insertions, 1 deletions
diff --git a/chaos-at-home/ch-sw0.yml b/chaos-at-home/ch-sw0.yml
new file mode 100644
index 00000000..bd2da22b
--- /dev/null
+++ b/chaos-at-home/ch-sw0.yml
@@ -0,0 +1,6 @@
+---
+- name: bootstrap
+ hosts: ch-sw0
+ gather_facts: no
+ roles:
+ - dellos6/bootstrap
diff --git a/chaos-at-home/group_vars/chaos_at_home_switches.yml b/chaos-at-home/group_vars/chaos_at_home_switches.yml
new file mode 100644
index 00000000..6284dd58
--- /dev/null
+++ b/chaos-at-home/group_vars/chaos_at_home_switches.yml
@@ -0,0 +1,8 @@
+$ANSIBLE_VAULT;1.2;AES256;chaos-at-home
+39633036643263323434343762626561623961306436353936623636303465343563333330353038
+6435373562623365636464643461623330326438346638610a643263303363393862313736303034
+39383835336533623835636233633935396165373061313036633435633432343233336661323362
+3861656139333537300a613332303536313263666139336363306335363663316433396439386430
+63313665663039646331613531383737623265396632383132653962336266626333303134373132
+38613636383561356631663765613961303732306664336538633733383663396132636339646538
+303661643036373037363639353362376133
diff --git a/inventory/group_vars/dellos6/main.yml b/inventory/group_vars/dellos6/main.yml
new file mode 100644
index 00000000..f0adaa77
--- /dev/null
+++ b/inventory/group_vars/dellos6/main.yml
@@ -0,0 +1,6 @@
+---
+ansible_connection: network_cli
+ansible_network_os: dellos6
+ansible_become: yes
+ansible_become_method: enable
+ansible_become_password: "{{ vault_ansible_become_password }}"
diff --git a/inventory/hosts.ini b/inventory/hosts.ini
index e602f606..9638bee8 100644
--- a/inventory/hosts.ini
+++ b/inventory/hosts.ini
@@ -22,7 +22,7 @@ mimas2 ansible_host=ch-mimas2 ansible_port=222
[chaos_at_home:children]
mz_chaos_at_home
-
+chaos_at_home_switches
[mz_chaos_at_home:vars]
ansible_port=222
@@ -32,6 +32,14 @@ mz-router ansible_host=chmz-router
mz-ap ansible_host=chmz-ap
+[chaos_at_home_switches:vars]
+ansible_port=22
+
+[chaos_at_home_switches]
+ch-sw0 host_name=sw0 ansible_host=192.168.42.200
+ch-sw1 host_name=sw1
+
+
[k8s_test:vars]
env_group=chaos-at-home
@@ -132,6 +140,9 @@ ele_infobeamer
###############################
# host categories
+[dellos6:children]
+chaos_at_home_switches
+
[kvmhosts]
#prometheus
atlas
diff --git a/roles/dellos6/bootstrap/tasks/main.yml b/roles/dellos6/bootstrap/tasks/main.yml
new file mode 100644
index 00000000..552aeddd
--- /dev/null
+++ b/roles/dellos6/bootstrap/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- name: generate initial configuration
+ delegate_to: localhost
+ pause:
+ prompt: "\n## Please apply the following configuration using the serial console!!!\n\n{{ lookup('template', 'init.j2') }}\n\n## end .. press enter to continue!!!!!\n"
+
+- name: get config facts from the switch
+ dellos6_facts:
+ gather_subset:
+ - hardware
+ register: switch_facts
+
+- debug:
+ var: switch_facts
diff --git a/roles/dellos6/bootstrap/templates/init.j2 b/roles/dellos6/bootstrap/templates/init.j2
new file mode 100644
index 00000000..2435c738
--- /dev/null
+++ b/roles/dellos6/bootstrap/templates/init.j2
@@ -0,0 +1,27 @@
+enable
+configure
+
+no ip domain-lookup
+hostname {{ host_name }}
+{# TODO: hardcoded address and vlan tag! #}
+interface vlan 1
+ip address 192.168.42.200 255.255.255.0
+exit
+no spanning-tree
+
+crypto key generate rsa
+crypto key generate dsa
+ip ssh server
+ip ssh pubkey-auth
+
+username "root" password {{ ansible_become_password }} privilege 15
+{% for ssh_key in ssh_keys_root %}
+crypto key pubkey-chain ssh user-key "root" rsa
+key-string row "{{ ssh_key }}"
+exit
+{% endfor %}
+
+enable password {{ ansible_become_password }}
+end
+
+write
diff --git a/roles/dellos6/docs.url b/roles/dellos6/docs.url
new file mode 100644
index 00000000..398d9526
--- /dev/null
+++ b/roles/dellos6/docs.url
@@ -0,0 +1 @@
+https://www.dell.com/support/home/us/en/04/product-support/servicetag/8xpsnk2/manuals