From fa5c726f9f39d834962f5157628bddfe85e026b6 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 21 Nov 2022 00:30:08 +0100 Subject: some more cleanups and fixes --- roles/dellos6/base/tasks/main.yml | 14 +++++++------- roles/dellos6/bootstrap/tasks/main.yml | 10 ++++------ 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'roles/dellos6') diff --git a/roles/dellos6/base/tasks/main.yml b/roles/dellos6/base/tasks/main.yml index 58c31d74..72193448 100644 --- a/roles/dellos6/base/tasks/main.yml +++ b/roles/dellos6/base/tasks/main.yml @@ -4,8 +4,8 @@ when: dellos6_sntp is defined dellos6_config: lines: - - "sntp server {{ dellos6_sntp.server }}" - - sntp unicast client enable + - "sntp server {{ dellos6_sntp.server }}" + - sntp unicast client enable notify: save configuration ## TODO: disable logging if dellos6_logging is not defined? @@ -13,8 +13,8 @@ when: dellos6_logging is defined dellos6_config: lines: - - "logging {{ dellos6_logging.server }}" - - exit + - "logging {{ dellos6_logging.server }}" + - exit notify: save configuration ## TODO: disable snmp if dellos6_snmp is not defined? @@ -22,7 +22,7 @@ when: dellos6_snmp is defined dellos6_config: lines: - - '{% if "location" in dellos6_snmp %}snmp-server location "{{ dellos6_snmp.location }}"{% else %}no snmp-server location{% endif %}' - - '{% if "contact" in dellos6_snmp %}snmp-server contact "{{ dellos6_snmp.contact }}"{% else %}no snmp-server contact{% endif %}' - - 'snmp-server community {{ dellos6_snmp.community }}' + - '{% if "location" in dellos6_snmp %}snmp-server location "{{ dellos6_snmp.location }}"{% else %}no snmp-server location{% endif %}' + - '{% if "contact" in dellos6_snmp %}snmp-server contact "{{ dellos6_snmp.contact }}"{% else %}no snmp-server contact{% endif %}' + - 'snmp-server community {{ dellos6_snmp.community }}' notify: save configuration diff --git a/roles/dellos6/bootstrap/tasks/main.yml b/roles/dellos6/bootstrap/tasks/main.yml index d6442e8f..af3bbcf1 100644 --- a/roles/dellos6/bootstrap/tasks/main.yml +++ b/roles/dellos6/bootstrap/tasks/main.yml @@ -1,19 +1,17 @@ --- - name: only one ssh key for root? - delegate_to: localhost - when: (ssh_keys_root | length) > 1 - fail: - msg: "users may have at the most one ssh-key" + assert: + that: (ssh_keys_root | length) > 1 + fail_msg: "users may have at the most one ssh-key" - 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 + - hardware register: switch_facts - debug: -- cgit v1.2.3