ansible-collections / dellemc.os10

GNU General Public License v3.0
39 stars 49 forks source link

Configure multi-line banner using dellemc.os10 #174

Open bsyingst83 opened 4 months ago

bsyingst83 commented 4 months ago
SUMMARY

Unable to find documentation for configuring a multi-line banner using dellemc.os10

ISSUE TYPE
COMPONENT NAME

os10_config module, or maybe os10_copy_config role? There don't seem to be any roles that specifically configure a banner

ANSIBLE VERSION
ansible [core 2.16.3]
  config file = /home/ansible/Frontier/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.1 (main, Feb 21 2024, 10:25:11) [GCC 8.5.0 20210514 (Red Hat 8.5.0-21)] (/usr/bin/python3.12)
  jinja version = 3.1.2
  libyaml = True
sanderploegsma commented 2 months ago

Just to weigh in here, I tried setting a motd banner using dellemc.os10.os10_config using the playbook below, but that eventually times out, probably because the first config line is somewhat interactive:

# configure-motd.yml
---
- name: Configure MOTD banner
  hosts: l3_switches
  tasks:
    - name: Gather OS10 facts
      dellemc.os10.os10_facts:
        gather_subset:
          - config
        register: os10_facts
    - name: Set motd banner
      dellemc.os10.os10_config:
        lines:
          - banner motd %
          - "{{ inventory_hostname }} - {{ os10_facts.ansible_facts.ansible_net_model }}"
          - "WARNING: This system configuration is managed by Ansible, do not edit by hand!"
          - "%"

So it seems like os10_config isn't the way to go here, so I'd appreciate another way to do it.