Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DHCP Configuration role #172

Merged
merged 4 commits into from
Apr 7, 2020

Conversation

titom73
Copy link
Contributor

@titom73 titom73 commented Mar 25, 2020

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Documentation content changes
  • Code style update (formatting, renaming)

Related Issue(s)

#171

Proposed changes

  • Fix documentation typo
  • Rename role from ztp_configuration to dhcp_configuration
  • State DHCP on Cloudvision is for lab only
  • Support package installation for fresh Centos server

How to test

On a Cloud version of centos 7:

Playbook file

---
- name: Configure DHCP service on CloudVision
  hosts: ztp_server
  gather_facts: no
  vars:
    ztp:
      default:
        registration: 'http://10.255.0.1/ztp/bootstrap'
        gateway: 10.255.0.3
        nameservers:
          - '10.255.0.3'
      general:
        subnets:
          - network: 10.255.0.0
            netmask: 255.255.255.0
            gateway: 10.255.0.3
            nameservers:
              - '10.255.0.3'
            start: 10.255.0.200
            end: 10.255.0.250
            lease_time: 300
      clients:
        - name: DC1-SPINE1
          mac: '0c:1d:c0:1d:62:01'
          ip4: 10.255.0.11
        - name: DC1-SPINE2
          mac: '0c:1d:c0:1d:62:02'
          ip4: 10.255.0.12
        - name: DC1-LEAF1A
          mac: '0c:1d:c0:1d:62:11'
          ip4: 10.255.0.13
  tasks:
  - name: 'Execute DHCP configuration role'
    import_role:
      name: arista.cvp.dhcp_configuration

Inventory

---
all:
  children:
    CVP:
      hosts:
        cv_ztp:
          ansible_host: 1.1.1.1
          ansible_user: centos
          ansible_password: password

Checklist:

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed (make linting and make sanity-lint).

@titom73 titom73 added type: documentation Improvements or additions to documentation state: accepted Issue is part of the development roadmap status: cherry_pick Issue / PR shall be cherry pick role: ztp_configuration Issue related to ztp_configuration role labels Mar 25, 2020
@titom73 titom73 self-assigned this Mar 25, 2020
@titom73 titom73 changed the title Fix documentation and role rename (#171) Update DHCP Configuration role (#171) Apr 3, 2020
@titom73 titom73 changed the title Update DHCP Configuration role (#171) Update DHCP Configuration role Apr 3, 2020
Add default vars and tasks to install dhcp package on a Centos/Red Hat
system.
@titom73
Copy link
Contributor Author

titom73 commented Apr 3, 2020

Idempotency validation:

  • Run 01: Installation
playbook dhcp-installation.yml -i inventory-as73.yml

PLAY [Configure ZTP service on CloudVision] **********

TASK [dhcp_configuration : Install packages] **********
changed: [ztp_server]

TASK [dhcp_configuration : Generate DHCPd configuration file] **********
changed: [ztp_server]

TASK [dhcp_configuration : Check & activate DHCP service] **********
changed: [ztp_server]

PLAY RECAP **********
ztp_server                 : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
  • Run 02: No change on system
playbook dhcp-installation.yml -i inventory-as73.yml

PLAY [Configure ZTP service on CloudVision] **********

TASK [dhcp_configuration : Install packages] **********
ok: [ztp_server]

TASK [dhcp_configuration : Generate DHCPd configuration file] **********
ok: [ztp_server]

TASK [dhcp_configuration : Check & activate DHCP service] **********
ok: [ztp_server]

PLAY RECAP **********
ztp_server                 : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Refactor Role to to support installation and configuration tasks to
support Centos and Ubuntu systems.

CVP is still supported for configuration tasks in a lab purpose.
@titom73
Copy link
Contributor Author

titom73 commented Apr 3, 2020

Multi OS support validation:

playbook dhcp-installation.yml -i inventory-as73.yml

PLAY [Configure ZTP service on CloudVision] *******

TASK [Gathering Facts] *******
ok: [dhcp_ubuntu_server]
ok: [dhcp_centos_server]

TASK [Inform about ansible_distribution] *******
ok: [dhcp_centos_server] => 
  msg: CentOS
ok: [dhcp_ubuntu_server] => 
  msg: Ubuntu

TASK [dhcp_configuration : gather os specific variables for Centos / Red Hat OS] ********
ok: [dhcp_centos_server]
skipping: [dhcp_ubuntu_server]

TASK [dhcp_configuration : gather os specific variables for Debian / Ubuntu OS] *******
skipping: [dhcp_centos_server]
ok: [dhcp_ubuntu_server]

TASK [dhcp_configuration : Install packages] *******
ok: [dhcp_centos_server]
ok: [dhcp_ubuntu_server]

TASK [dhcp_configuration : Generate DHCPd configuration file] *******
ok: [dhcp_ubuntu_server]
ok: [dhcp_centos_server]

TASK [dhcp_configuration : Check & activate DHCP service] *******
changed: [dhcp_ubuntu_server]
ok: [dhcp_centos_server]

PLAY RECAP *******
dhcp_centos_server         : ok=6    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   
dhcp_ubuntu_server         : ok=6    changed=1    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0

@titom73 titom73 changed the base branch from releases/v1.0.x to releases/v1.1.x April 7, 2020 13:26
@titom73 titom73 changed the base branch from releases/v1.1.x to releases/v1.0.x April 7, 2020 13:26
@titom73 titom73 merged commit d31d0ff into releases/v1.0.x Apr 7, 2020
@titom73 titom73 deleted the issues/171-ztp-fix-documentation branch April 7, 2020 13:26
@titom73 titom73 mentioned this pull request Apr 22, 2020
@titom73 titom73 added status: testing PR under testing and removed state: accepted Issue is part of the development roadmap labels May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: ztp_configuration Issue related to ztp_configuration role status: cherry_pick Issue / PR shall be cherry pick status: testing PR under testing type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant