From 38ef9475011c623349a8043dd8c1bb8e790d8bb4 Mon Sep 17 00:00:00 2001 From: anna-savina Date: Thu, 30 May 2024 12:34:32 +0300 Subject: [PATCH] fixed example playbooks --- .../20240530-readme_playbook_example.yml | 2 + .../README.md | 45 ++++++------ .../azure_manage_network_interface/README.md | 44 ++++++------ roles/azure_manage_networking_stack/README.md | 33 +++++---- roles/azure_manage_postgresql/README.md | 31 +++++---- roles/azure_manage_resource_group/README.md | 21 +++--- roles/azure_manage_security_group/README.md | 68 ++++++++++--------- .../README.md | 50 +++++++------- 8 files changed, 160 insertions(+), 134 deletions(-) create mode 100644 changelogs/fragments/20240530-readme_playbook_example.yml diff --git a/changelogs/fragments/20240530-readme_playbook_example.yml b/changelogs/fragments/20240530-readme_playbook_example.yml new file mode 100644 index 00000000..32531e91 --- /dev/null +++ b/changelogs/fragments/20240530-readme_playbook_example.yml @@ -0,0 +1,2 @@ +bugfixes: + - Update README.md with proper playbook examples \ No newline at end of file diff --git a/roles/azure_load_balancer_with_public_ip/README.md b/roles/azure_load_balancer_with_public_ip/README.md index 4019db90..d9d45c7c 100644 --- a/roles/azure_load_balancer_with_public_ip/README.md +++ b/roles/azure_load_balancer_with_public_ip/README.md @@ -62,27 +62,30 @@ Example Playbook ---------------- - hosts: localhost - roles: - - role: cloud.azure_ops.azure_load_balancer_with_public_ip - azure_load_balancer_with_public_ip_operation: "create" - azure_load_balancer_with_public_ip_region: "canadacentral" - azure_load_balancer_with_public_ip_resource_group: "rg" - azure_load_balancer_with_public_ip_load_balancer: - name: "example-lb" - probes: - - name: lb-probe - port: 5000 - rules: - - name: lb-rule - probe: lb-probe - backend_address_pool: 'default' - frontend_ip_configuration: 'default' - frontend_port: 5000 - backend_port: 5000 - sku: 'Standard' - tags: - tag0: 'test0' - tag1: 'test1' + tasks: + - name: Create Load Balancer with Public IP + ansible.builtin.include_role: + name: cloud.azure_ops.azure_load_balancer_with_public_ip + vars: + azure_load_balancer_with_public_ip_operation: create + azure_load_balancer_with_public_ip_region: 'eastus' + azure_load_balancer_with_public_ip_resource_group: 'resource-group' + azure_load_balancer_with_public_ip_load_balancer: + name: 'example-lb' + probes: + - name: lb-probe + port: 5000 + rules: + - name: lb-rule + probe: lb-probe + backend_address_pool: 'default' + frontend_ip_configuration: 'default' + frontend_port: 5000 + backend_port: 5000 + sku: 'Standard' + tags: + tag0: 'test0' + tag1: 'test1' License ------- diff --git a/roles/azure_manage_network_interface/README.md b/roles/azure_manage_network_interface/README.md index 5a534861..ed40b2cc 100644 --- a/roles/azure_manage_network_interface/README.md +++ b/roles/azure_manage_network_interface/README.md @@ -49,29 +49,33 @@ Example Playbook ---------------- - hosts: localhost - roles: + tasks: - name: Create a Network Interface with Default Security Group - role: cloud.azure_ops.azure_manage_network_interface - azure_manage_network_interface_operation: 'create' - azure_manage_network_interface_resource_group: 'nic-example' - azure_manage_network_interface_interface: - name: 'nic' - vnet_name: 'vnet' - subnet_name: 'subnet' - ip_configurations: - - name: ipconf1 - public_ip_address_name: 'pip' - primary: True - tags: - tag0: 'test0' - tag1: 'test1' + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_network_interface + vars: + azure_manage_network_interface_operation: create + azure_manage_network_interface_resource_group: 'resource-group' + azure_manage_network_interface_interface: + name: 'nic' + vnet_name: 'vnet' + subnet_name: 'subnet' + ip_configurations: + - name: ipconf1 + primary: true + public_ip_address_name: 'pip' + tags: + tag0: "test0" + tag1: "test1" - name: Cleanup Network Interface and Default Security Group - role: cloud.azure_ops.azure_manage_network_interface - azure_manage_network_interface_operation: 'delete' - azure_manage_network_interface_resource_group: 'nic-example' - azure_manage_network_interface_interface: - name: 'nic' + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_network_interface + vars: + azure_manage_network_interface_operation: delete + azure_manage_network_interface_resource_group: 'resource-group' + azure_manage_network_interface_interface: + name: 'nic' License ------- diff --git a/roles/azure_manage_networking_stack/README.md b/roles/azure_manage_networking_stack/README.md index 033f4721..b8976e90 100644 --- a/roles/azure_manage_networking_stack/README.md +++ b/roles/azure_manage_networking_stack/README.md @@ -34,21 +34,24 @@ Example Playbook ---------------- - hosts: localhost - roles: - - role: cloud.azure_ops.azure_manage_networking_stack - azure_manage_networking_stack_operation: "create" - azure_manage_networking_stack_region: "eastus" - azure_manage_networking_stack_resource_group: "testing-resource-group" - azure_manage_networking_stack_virtual_network: "my-vnet" - azure_manage_networking_stack_subnet: "my-subnet-00" - azure_manage_networking_stack_vnet_address_prefixes_cidr: - - "10.1.0.0/16" - - "172.100.0.0/16" - azure_manage_networking_stack_subnet_address_prefixes_cidr: - - "172.100.0.0/8" - azure_manage_networking_stack_tags: - tag0: "tag0" - tag1: "tag1" + tasks: + - name: Create Networking stack + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_networking_stack + vars: + azure_manage_networking_stack_operation: create + azure_manage_networking_stack_region: 'eastus' + azure_manage_networking_stack_resource_group: 'resource-group' + azure_manage_networking_stack_virtual_network: 'vnet' + azure_manage_networking_stack_subnet: 'subnet' + azure_manage_networking_stack_vnet_address_prefixes_cidr: + - "10.1.0.0/16" + - "172.100.0.0/16" + azure_manage_networking_stack_subnet_address_prefixes_cidr: + - "172.100.0.0/8" + azure_manage_networking_stack_tags: + tag0: "tag0" + tag1: "tag1" License ------- diff --git a/roles/azure_manage_postgresql/README.md b/roles/azure_manage_postgresql/README.md index 8bbe8555..3e7ad19e 100644 --- a/roles/azure_manage_postgresql/README.md +++ b/roles/azure_manage_postgresql/README.md @@ -58,26 +58,29 @@ Example Playbook ---------------- - hosts: localhost - roles: - - role: cloud.azure_ops.azure_manage_postgresql - azure_manage_postgresql_postgresql_name: postgresql-server - azure_manage_postgresql_operation: "create" - azure_manage_postgresql_region: "eastus" - azure_manage_postgresql_resource_group: "postgresql-rg" - azure_manage_postgresql_postgresql_backup_retention_days: 10 - azure_manage_postgresql_postgresql_admin_username: ansible - azure_manage_postgresql_postgresql_admin_password: ansible-testing-123 - azure_manage_postgresql_postgresql_storage_mb: 5120 - azure_manage_postgresql_postgresql_sku: + tasks: + - name: Create PostgreSQL server + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_postgresql + vars: + azure_manage_postgresql_postgresql_name: postgresql-server + azure_manage_postgresql_operation: create + azure_manage_postgresql_region: 'eastus' + azure_manage_postgresql_resource_group: 'resource-group' + azure_manage_postgresql_postgresql_backup_retention_days: 10 + azure_manage_postgresql_postgresql_admin_username: 'azureuser' + azure_manage_postgresql_postgresql_admin_password: 'Password123!' + azure_manage_postgresql_postgresql_storage_mb: 5120 + azure_manage_postgresql_postgresql_sku: name: B_Gen5_1 tier: Basic - azure_manage_postgresql_resource_group_tags: + azure_manage_postgresql_resource_group_tags: tag0: "tag0" tag1: "tag1" - azure_manage_postgresql_postgresql_settings: + azure_manage_postgresql_postgresql_settings: - name: deadlock_timeout value: 2000 - azure_manage_postgresql_postgresql_firewall_rule: + azure_manage_postgresql_postgresql_firewall_rule: - name: rule_0 start_ip_address: 172.10.1.0 end_ip_address: 172.10.128.0 diff --git a/roles/azure_manage_resource_group/README.md b/roles/azure_manage_resource_group/README.md index 1955897a..e1e696fa 100644 --- a/roles/azure_manage_resource_group/README.md +++ b/roles/azure_manage_resource_group/README.md @@ -29,15 +29,18 @@ Example Playbook ---------------- - hosts: localhost - roles: - - role: cloud.azure_ops.azure_manage_resource_group - azure_manage_resource_group_operation: "create" - azure_manage_resource_group_region: "eastus" - azure_manage_resource_group_name: "testing-resource-group" - azure_manage_resource_group_tags: - tag0: "tag0" - tag1: "tag1" - azure_manage_resource_group_lock_resource_group: true + tasks: + - name: Create Resource Group + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_resource_group + vars: + azure_manage_resource_group_operation: create + azure_manage_resource_group_region: 'eastus' + azure_manage_resource_group_name: 'resource-group' + azure_manage_resource_group_tags: + tag0: "tag0" + tag1: "tag1" + azure_manage_resource_group_lock_resource_group: true License ------- diff --git a/roles/azure_manage_security_group/README.md b/roles/azure_manage_security_group/README.md index 91fb354a..c1a48873 100644 --- a/roles/azure_manage_security_group/README.md +++ b/roles/azure_manage_security_group/README.md @@ -42,39 +42,43 @@ Example Playbook ---------------- - hosts: localhost - roles: - - name: Create a security group with custom rules - role: cloud.azure_ops.azure_manage_security_group - azure_manage_security_group_resource_group: 'my_resource_group' - azure_manage_security_group_region: eastus - azure_manage_security_group_operation: 'create' - azure_manage_security_group_security_group: - name: "{{ azure_resource_group }}-sg" - rules: - - name: 'allow_ssh' - protocol: Tcp - destination_port_range: - - 22 - access: Allow - priority: 100 - direction: Inbound - - name: 'allow_web_traffic' - protocol: Tcp - destination_port_range: - - 80 - - 443 - access: Allow - priority: 101 - direction: Inbound + tasks: + - name: Create Security Group with custom rules + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_security_group + vars: + azure_manage_security_group_resource_group: 'resource-group' + azure_manage_security_group_region: 'eastus' + azure_manage_security_group_operation: create + azure_manage_security_group_security_group: + name: 'security-group' + rules: + - name: 'allow_ssh' + protocol: Tcp + destination_port_range: + - 22 + access: Allow + priority: 100 + direction: Inbound + - name: 'allow_web_traffic' + protocol: Tcp + destination_port_range: + - 80 + - 443 + access: Allow + priority: 101 + direction: Inbound - - name: Remove rules from security group - role: cloud.azure_ops.azure_manage_security_group - azure_manage_security_group_resource_group: 'my_resource_group' - azure_manage_security_group_security_group: - name: "{{ azure_resource_group }}-sg" - rules_to_remove: - - 'allow_ssh' - - 'allow_web_traffic' + - name: Remove rules from Security Group + ansible.builtin.include_role: + name: cloud.azure_ops.azure_manage_security_group + vars: + azure_manage_security_group_resource_group: 'resource-group' + azure_manage_security_group_security_group: + name: 'security-group' + rules_to_remove: + - 'allow_ssh' + - 'allow_web_traffic' License ------- diff --git a/roles/azure_virtual_machine_with_public_ip/README.md b/roles/azure_virtual_machine_with_public_ip/README.md index deb919d5..ca47dc57 100644 --- a/roles/azure_virtual_machine_with_public_ip/README.md +++ b/roles/azure_virtual_machine_with_public_ip/README.md @@ -55,32 +55,36 @@ Example Playbook ---------------- - hosts: localhost - roles: + tasks: - name: Create a load balanced virtual machine with a default network interface - role: cloud.azure_ops.azure_virtual_machine_with_public_ip - azure_virtual_machine_with_public_ip_operation: 'create' - azure_virtual_machine_with_public_ip_region: eastus - azure_virtual_machine_with_public_ip_resource_group: 'my_resource_group' - azure_virtual_machine_with_public_ip_vm: - name: "example-vm" - admin_username: 'azureuser' - admin_password: 'adminpass' - image: - offer: RHEL - publisher: RedHat - sku: 7-LVM - version: latest - size: Standard_DS1_v2 - load_balancer_backend_address_pools: - - name: 'default' - load_balancer: 'existing-lb' + ansible.builtin.include_role: + name: cloud.azure_ops.azure_virtual_machine_with_public_ip + vars: + azure_virtual_machine_with_public_ip_operation: create + azure_virtual_machine_with_public_ip_region: 'eastus' + azure_virtual_machine_with_public_ip_resource_group: 'resource-group' + azure_virtual_machine_with_public_ip_vm: + name: 'example-vm' + admin_username: 'azureuser' + admin_password: 'Password123!' + image: + offer: RHEL + publisher: RedHat + sku: 8-LVM + version: latest + size: Standard_B1ms + load_balancer_backend_address_pools: + - name: 'default' + load_balancer: 'existing-lb' - name: Delete virtual machine and all autocreated resources - role: cloud.azure_ops.azure_virtual_machine_with_public_ip - azure_virtual_machine_with_public_ip_operation: 'delete' - azure_virtual_machine_with_public_ip_remove_on_absent: 'all_autocreated' - azure_virtual_machine_with_public_ip_vm: - name: "example-vm" + ansible.builtin.include_role: + cloud.azure_ops.azure_virtual_machine_with_public_ip + vars: + azure_virtual_machine_with_public_ip_operation: delete + azure_virtual_machine_with_public_ip_remove_on_absent: 'all_autocreated' + azure_virtual_machine_with_public_ip_vm: + name: 'example-vm' License -------