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

Fix issue with cv_container and relative topology #175

Merged
merged 5 commits into from
Apr 7, 2020

Conversation

titom73
Copy link
Contributor

@titom73 titom73 commented Mar 30, 2020

Summary:

Update code to support deletion of container topology not using CVP root
container.

Deletion example:

    CVP_CONTAINERS:
      POD01:
        parent_container: Leafs

Fix: #173

Tested with :

  • Addition of a complete topology
  • Deletion of POD01
  • Creation with partial topology already deployed
  • Deletion of full topology

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Related Issue(s)

Fix: #173

Proposed changes

How to test

  1. Create topology:
- name: Container Management in Cloudvision
  hosts: cv_server
  connection: local
  gather_facts: false
  collections:
    - arista.avd
    - arista.cvp
  vars:
    run_tasks: false
    run_mode: merge
    CVP_CONTAINERS:
      DC2:
        parent_container: Tenant
      Leafs:
        parent_container: DC2
      Spines:
        parent_container: DC2
      POD01:
        parent_container: Leafs

  tasks:
    - name: "collect CV facts on {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: CVP_FACTS

    - name: 'running cv_container in {{run_mode}} on {{inventory_hostname}}'
      arista.cvp.cv_container:
        cvp_facts: "{{CVP_FACTS.ansible_facts}}"
        topology: "{{CVP_CONTAINERS}}"
        mode: '{{run_mode}}'
      register: result

    - debug:
        msg: '{{result}}'
  1. Delete topology
- name: Container Management in Cloudvision
  hosts: cv_server
  connection: local
  gather_facts: false
  collections:
    - arista.avd
    - arista.cvp
  vars:
    run_tasks: false
    run_mode: delete
    CVP_CONTAINERS:
      POD01:
        parent_container: Leafs

  tasks:
    - name: "collect CV facts on {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: CVP_FACTS

    - name: 'running cv_container in {{run_mode}} on {{inventory_hostname}}'
      arista.cvp.cv_container:
        cvp_facts: "{{CVP_FACTS.ansible_facts}}"
        topology: "{{CVP_CONTAINERS}}"
        mode: '{{run_mode}}'
      register: result

    - debug:
        msg: '{{result}}'

Checklist:

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

Summary:
--------
Update code to support deletion of container topology not using CVP root
container.

Deletion example:

```yaml
    CVP_CONTAINERS:
      POD01:
        parent_container: Leafs
```

Fix: #173

Tested with :
-------------
- Addition of a complete topology
- Deletion of POD01
- Creation with partial topology already deployed
- Deletion of full topology
@titom73 titom73 added type: bug Something isn't working status: in-progress Currently under investigation or implementation module: cv_container Issue related to cv_container module state: accepted Issue is part of the development roadmap bug labels Mar 30, 2020
@titom73 titom73 added this to the v1.1 milestone Mar 30, 2020
@titom73 titom73 self-assigned this Mar 30, 2020
@titom73 titom73 added the status: cherry_pick Issue / PR shall be cherry pick label Mar 31, 2020
@titom73 titom73 marked this pull request as ready for review April 3, 2020 08:43
@titom73 titom73 merged commit c228aa0 into releases/v1.1.x Apr 7, 2020
@titom73 titom73 deleted the issues/173-cv-container branch April 7, 2020 13:25
@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 status: in-progress Currently under investigation or implementation labels May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cv_container Issue related to cv_container module status: cherry_pick Issue / PR shall be cherry pick status: testing PR under testing type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant