Skip to content

Commit

Permalink
Merge pull request #54 from alinabuzachis/fix_ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
alinabuzachis authored Mar 8, 2024
2 parents cc4ca44 + ca81246 commit cfe72d5
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 86 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

'on':
on:
push:
pull_request:

jobs:
linters:
uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
- uses: actions/checkout@v4

- name: Run ansible-lint
uses: ansible/ansible-lint-action@main
with:
action_ref: v6.17.2
uses: ansible/[email protected]

tox-linters:
uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
64 changes: 0 additions & 64 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,6 @@ on:
jobs:
sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
with:
matrix_include: "[]"
matrix_exclude: >-
[
{
"ansible-version": "stable-2.9"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.8"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.7"
},
{
"ansible-version": "milestone",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.9"
},
{
"ansible-version": "devel",
"python-version": "3.7"
},
{
"ansible-version": "devel",
"python-version": "3.8"
},
{
"ansible-version": "devel",
"python-version": "3.9"
}
]
all_green:
if: ${{ always() }}
needs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The collection includes a variety of Ansible roles and playbook to help automate
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.13.0**.
This collection has been tested against following Ansible versions: **>=2.14.0**.

## Included content

Expand Down
9 changes: 9 additions & 0 deletions changelogs/fragments/202400305-fixes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
breaking_changes:
- "Update README.md and meta/runtime.yml to reflect our ansible core testing versions."

trivial:
- "Increase ansible-lint version to 1.22"

bugfixes:
- roles/azure_manage_resource_group - Ensure the correct variable name is used for the operation.
- roles/azure_virtual_machine_with_public_ip - Ensure the correct variables names are defined inside defaults.
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requires_ansible: '>=2.13.0'
requires_ansible: '>=2.14.0'
2 changes: 1 addition & 1 deletion roles/azure_manage_resource_group/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
# defaults file for resource_group
operation: create
azure_manage_resource_group_operation: create
4 changes: 2 additions & 2 deletions roles/azure_manage_resource_group/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Check operation validation
- name: Check azure_manage_resource_group_operation validation
ansible.builtin.fail:
msg: Please provide operation as 'create' or 'delete'
msg: Please provide azure_manage_resource_group_operation as 'create' or 'delete'
when: azure_manage_resource_group_operation not in ['create', 'delete']

- name: Check Resource group name
Expand Down
4 changes: 2 additions & 2 deletions roles/azure_virtual_machine_with_public_ip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Role Variables
--------------

* **azure_virtual_machine_with_public_ip_operation**: Operation to perform. Valid values are 'create', 'delete', 'power_on', 'power_off', 'deallocate', 'restart'. Default is 'create'.
* **azure_virtual_machine_with_public_ip_remove_on_absent**: Specify which resources to remove when `operation='delete'`. 'all' removes all resources attached to the VM being removed; 'all_autocreated' removes the resources that were automatically created while provisioning the VM (public ip, network interface, security group). To remove only specific resources, use the values 'network_interfaces', 'virtual_storage', or 'public_ips'. The default value is 'all'.
* **azure_virtual_machine_with_public_ip_resource_group**: Resource group on/from which the virtual machine will reside. When `operation='create'`, this resource group will be created if it does not exist.
* **azure_virtual_machine_with_public_ip_remove_on_absent**: Specify which resources to remove when `azure_virtual_machine_with_public_ip_operation='delete'`. 'all' removes all resources attached to the VM being removed; 'all_autocreated' removes the resources that were automatically created while provisioning the VM (public ip, network interface, security group). To remove only specific resources, use the values 'network_interfaces', 'virtual_storage', or 'public_ips'. The default value is 'all'.
* **azure_virtual_machine_with_public_ip_resource_group**: Resource group on/from which the virtual machine will reside. When `azure_virtual_machine_with_public_ip_operation='create'`, this resource group will be created if it does not exist.
* **azure_virtual_machine_with_public_ip_region**: An Azure location for the resources.
* **azure_virtual_machine_with_public_ip_tags**: Dictionary of string:string pairs to assign as metadata to the resource group.
* **azure_virtual_machine_with_public_ip_vm**: Object used to provide details for a virtual machine. Contains the following:
Expand Down
6 changes: 3 additions & 3 deletions roles/azure_virtual_machine_with_public_ip/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# defaults file for virtual_machine
operation: create
azure_vm: {}
remove_on_absent: all
azure_virtual_machine_with_public_ip_operation: create
azure_virtual_machine_with_public_ip_vm: {}
azure_virtual_machine_with_public_ip_remove_on_absent: all
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
- name: default
primary: true
public_ip_address_name: "{{ vm_name }}"
load_balancer_backend_address_pools: "{{ azure_vm.load_balancer_backend_address_pools | default(omit) }}"
load_balancer_backend_address_pools: "{{ azure_virtual_machine_with_public_ip_vm.load_balancer_backend_address_pools | default(omit) }}"

- name: Tag all autocreated resources for cleanup
ansible.builtin.set_fact:
Expand Down
6 changes: 3 additions & 3 deletions roles/azure_virtual_machine_with_public_ip/tasks/delete.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Fail on invalid delete option
ansible.builtin.fail:
msg: Invalid value for remove_on_absent. Valid values include 'all', 'all_autocreated', 'network_interfaces', 'virtual_storage', or 'public_ips'
when: remove_on_absent not in ['all', 'all_autocreated', 'network_interfaces', 'virtual_storage', 'public_ips']
msg: Invalid value for azure_virtual_machine_with_public_ip_remove_on_absent. Valid values include 'all', 'all_autocreated', 'network_interfaces', 'virtual_storage', or 'public_ips'
when: azure_virtual_machine_with_public_ip_remove_on_absent not in ['all', 'all_autocreated', 'network_interfaces', 'virtual_storage', 'public_ips']

- name: Fail when resource group doesn't exist
ansible.builtin.fail:
Expand All @@ -13,5 +13,5 @@
azure.azcollection.azure_rm_virtualmachine:
resource_group: "{{ azure_resource_group }}"
name: "{{ vm_name }}"
remove_on_absent: "{{ remove_on_absent | default(omit) }}"
remove_on_absent: "{{ azure_virtual_machine_with_public_ip_remove_on_absent | default(omit) }}"
state: absent
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ skipsdist = True
[testenv:ansible-lint]
; There is currently a bug in ansible-lint 6.8.6: https://github.com/ansible/ansible-lint/issues/2673
deps =
ansible-lint==v6.17.2
ansible-lint==v6.22.0
commands = ansible-lint --show-relpath

[testenv:linters]
Expand Down

0 comments on commit cfe72d5

Please sign in to comment.