Skip to content

Commit 1fa7caf

Browse files
update files erros and workflows
1 parent 7fa67e3 commit 1fa7caf

File tree

61 files changed

+532
-557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+532
-557
lines changed

.github/workflows/sanity_tests.yml

Lines changed: 21 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
---
22
name: CI
3-
43
on:
54
push:
65
branches: [main]
6+
pull_request:
77
schedule:
88
- cron: '0 6 * * *'
9-
workflow_dispatch:
10-
# pull_request:
11-
129
env:
1310
NAMESPACE: cisco
1411
COLLECTION_NAME: catalystcenter
1512

1613
jobs:
1714
sanity:
1815
name: Sanity (Ⓐ${{ matrix.ansible }})
16+
timeout-minutes: 60
1917
strategy:
2018
matrix:
2119
ansible:
2220
- stable-2.17
2321
- stable-2.18
22+
- devel
2423
runs-on: ubuntu-22.04
25-
2624
steps:
2725
- name: Check out code
2826
uses: actions/checkout@v3
@@ -43,57 +41,26 @@ jobs:
4341
- name: Install ansible-base (${{ matrix.ansible }})
4442
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
4543

46-
- name: Run sanity tests
44+
- name: Add swap space (2 GB)
4745
run: |
48-
timeout 55m bash -c '
49-
while true; do echo "⏳ Sanity running..."; sleep 60; done &
50-
ansible-test sanity --docker --docker-privileged -v --color
51-
'
52-
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
53-
54-
- name: Install yamllint
55-
run: pip install --user yamllint
56-
57-
- name: Run yamllint
58-
run: yamllint -c .yamllint.yml .
59-
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
60-
61-
sanity-devel:
62-
name: Sanity (Ⓐdevel)
63-
runs-on: ubuntu-22.04
64-
continue-on-error: true # No bloquea el resto del pipeline
65-
66-
steps:
67-
- name: Check out code
68-
uses: actions/checkout@v3
69-
with:
70-
path: cisco-en-programmability/dnacenter-ansible
46+
sudo fallocate -l 2G /swapfile
47+
sudo chmod 600 /swapfile
48+
sudo mkswap /swapfile
49+
sudo swapon /swapfile
7150
72-
- name: Create directory
73-
run: mkdir -p ./ansible_collections/${{env.NAMESPACE}}
74-
75-
- name: Move repository
76-
run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
77-
78-
- name: Set up Python
79-
uses: actions/setup-python@v3
80-
with:
81-
python-version: '3.11'
82-
83-
- name: Install ansible-base (devel)
84-
run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
85-
86-
- name: Run sanity tests (devel)
51+
- name: Run sanity tests
8752
run: |
88-
timeout 55m bash -c '
89-
while true; do echo "⏳ Devel sanity running..."; sleep 60; done &
90-
ansible-test sanity --docker --docker-privileged -v --color
91-
'
53+
if [ "${{ matrix.ansible }}" = "devel" ]; then
54+
echo "⚠ Running reduced tests for devel branch"
55+
ansible-test sanity --docker -v --color --test pep8 --test validate-modules
56+
else
57+
ansible-test sanity --docker -v --color
58+
fi
9259
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
9360

94-
- name: Install yamllint
95-
run: pip install --user yamllint
96-
97-
- name: Run yamllint
98-
run: yamllint -c .yamllint.yml .
99-
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
61+
- name: Dump docker logs (if any)
62+
if: failure()
63+
run: |
64+
echo "🧪 Collecting logs from Docker containers..."
65+
docker ps -a
66+
docker logs $(docker ps -aq --filter name=ansible-test-controller || true) || true

changelogs/changelog.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ releases:
5353
minor_changes:
5454
- The format has been updated to correct errors when uploading a new version to Red Hat.
5555
- The workflow_manager modules have been updated.
56+
- Change host to _host
57+
- Change cport to _api_port
58+
- Change username to _username
59+
- Change password to _password
60+
- Change verify to _verify
61+
- Change version to _version
62+
- Change debug to _debug
63+
- This was due to problems with the parameters since there were conflicts

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tags:
3030
- networking
3131
- sdn
3232
dependencies:
33-
ansible.utils: ">=2.0.0,<5.0"
33+
ansible.utils: ">=2.0.0,<7.0"
3434
repository: https://github.com/cisco-en-programmability/catalystcenter-ansible
3535
documentation: https://cisco-en-programmability.github.io/catalystcenter-ansible/
3636
homepage: https://github.com/cisco-en-programmability/catalystcenter-ansible

playbooks/PnP.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
- "{{ CLUSTERFILE }}"
88
vars:
99
catalystcenter_login: &catalystcenter_login
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
api_port: "{{ api_port }}"
15-
version: "{{ version }}"
16-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_api_port: "{{ _api_port }}"
15+
_version: "{{ _version }}"
16+
_debug: "{{ _debug }}"
1717
log_level: DEBUG
1818
tasks:
1919
- name: Import devices in bulk

playbooks/PnP_Workflow_Manager_Playbook.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
- "{{ CLUSTERFILE }}"
88
vars:
99
catalystcenter_login: &catalystcenter_login
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
api_port: "{{ api_port }}"
15-
version: "{{ version }}"
16-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_api_port: "{{ _api_port }}"
15+
_version: "{{ _version }}"
16+
_debug: "{{ _debug }}"
1717
log_level: DEBUG
1818
tasks:
1919
- name: Import devices in bulk

playbooks/accesspoint_workflow_manager.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
tasks:
99
- name: Updating Access Point Site / Configuration details
1010
cisco.catalystcenter.accesspoint_workflow_manager:
11-
host: "{{ host }}"
12-
username: "{{ username }}"
13-
password: "{{ password }}"
14-
verify: "{{ verify }}"
15-
api_port: "{{ api_port }}"
16-
version: "{{ version }}"
17-
debug: "{{ debug }}"
11+
_host: "{{ _host }}"
12+
_username: "{{ _username }}"
13+
_password: "{{ _password }}"
14+
_verify: "{{ _verify }}"
15+
_api_port: "{{ _api_port }}"
16+
_version: "{{ _version }}"
17+
_debug: "{{ _debug }}"
1818
log: true
1919
log_level: DEBUG
2020
config_verify: true

playbooks/app_policy_queuing_profile.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
tasks:
88
- name: Create
99
cisco.catalystcenter.app_policy_queuing_profile:
10-
_host: "{{ host }}"
11-
_username: "{{ username }}"
12-
_password: "{{ password }}"
13-
_verify: "{{ verify }}"
14-
_api_port: "{{ api_port }}"
15-
_version: "{{ version }}"
16-
_debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_api_port: "{{ _api_port }}"
15+
_version: "{{ _version }}"
16+
_debug: "{{ _debug }}"
1717
state: present
1818
id: "a"
1919
payload:

playbooks/application_set_info.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
tasks:
88
- name: Get application sets local-services
99
cisco.catalystcenter.application_sets_info:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
1414
name: local-services
1515
# limit: 3
1616
# offset: 2

playbooks/application_sets.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
tasks:
88
- name: Create an application set
99
cisco.catalystcenter.application_sets:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_debug: "{{ _debug }}"
1515
state: present
1616
payload:
1717
- name: AppSet1
1818
register: application_set_result
1919
- name: Get task info
2020
cisco.catalystcenter.task_info:
21-
host: "{{ host }}"
22-
username: "{{ username }}"
23-
password: "{{ password }}"
24-
verify: "{{ verify }}"
21+
_host: "{{ _host }}"
22+
_username: "{{ _username }}"
23+
_password: "{{ _password }}"
24+
_verify: "{{ _verify }}"
2525
taskId: "{{ application_set_result.catalystcenter_response.response.taskId }}"
2626
when:
2727
- application_set_result.catalystcenter_response is defined

playbooks/applications.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
tasks:
88
- name: Create an application
99
cisco.catalystcenter.applications:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_debug: "{{ _debug }}"
1515
state: present
1616
payload:
1717
- name: itunes-video
@@ -45,10 +45,10 @@
4545
register: application_result
4646
- name: Get task info
4747
cisco.catalystcenter.task_info:
48-
host: "{{ host }}"
49-
username: "{{ username }}"
50-
password: "{{ password }}"
51-
verify: "{{ verify }}"
48+
_host: "{{ _host }}"
49+
_username: "{{ _username }}"
50+
_password: "{{ _password }}"
51+
_verify: "{{ _verify }}"
5252
taskId: "{{ application_result.catalystcenter_response.response.taskId }}"
5353
when:
5454
- application_result.catalystcenter_response is defined

playbooks/authentication_import.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
tasks:
88
- name: Import certificate file
99
cisco.catalystcenter.authentication_import_certificate:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_debug: "{{ _debug }}"
1515
certFilePath: ./files/test.template
1616
pkFilePath: ./files/test.template
1717
register: result

playbooks/command_runner_run_command.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
tasks:
88
- name: Run command
99
cisco.catalystcenter.command_runner_run_command:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
1414
commands:
1515
- pwd
1616
deviceUuids:
@@ -21,10 +21,10 @@
2121
msg: "{{ result }}"
2222
- name: Get task info
2323
cisco.catalystcenter.task_info:
24-
host: "{{ host }}"
25-
username: "{{ username }}"
26-
password: "{{ password }}"
27-
verify: "{{ verify }}"
24+
_host: "{{ _host }}"
25+
_username: "{{ _username }}"
26+
_password: "{{ _password }}"
27+
_verify: "{{ _verify }}"
2828
taskId: "{{ result.catalystcenter_response.response.taskId }}"
2929
when:
3030
- result.catalystcenter_response is defined

playbooks/configs_backup.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
- "{{ CLUSTERFILE }}"
88
vars:
99
catalystcenter_login: &catalystcenter_login
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
api_port: "{{ api_port }}"
15-
version: "{{ version }}"
16-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_api_port: "{{ _api_port }}"
15+
_version: "{{ _version }}"
16+
_debug: "{{ _debug }}"
1717
log_level: "DEBUG"
1818
tasks:
1919
- name: Take backup of a wired 9500 switch

playbooks/configuration_template_version_create.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
tasks:
88
- name: Create Configuration Template Version
99
cisco.catalystcenter.configuration_template_version_create:
10-
host: "{{ host }}"
11-
username: "{{ username }}"
12-
password: "{{ password }}"
13-
verify: "{{ verify }}"
14-
api_port: "{{ api_port }}"
15-
version: "{{ version }}"
16-
debug: "{{ debug }}"
10+
_host: "{{ _host }}"
11+
_username: "{{ _username }}"
12+
_password: "{{ _password }}"
13+
_verify: "{{ _verify }}"
14+
_api_port: "{{ _api_port }}"
15+
_version: "{{ _version }}"
16+
_debug: "{{ _debug }}"
1717
# comments: string
1818
templateId: 2121f1d7-d9ea-4eea-8f83-45af2941f5f9
1919
register: configuration_template_version_create_result
2020
- name: Get task info
2121
cisco.catalystcenter.task_info:
22-
host: "{{ host }}"
23-
username: "{{ username }}"
24-
password: "{{ password }}"
25-
verify: "{{ verify }}"
22+
_host: "{{ _host }}"
23+
_username: "{{ _username }}"
24+
_password: "{{ _password }}"
25+
_verify: "{{ _verify }}"
2626
taskId: "{{ configuration_template_version_create_result.catalystcenter_response.response.taskId }}"
2727
when:
2828
- configuration_template_version_create_result.catalystcenter_response is defined

0 commit comments

Comments
 (0)