0

I am trying to run the blueprint Ansible-Azure-VPC which is in the marketplace of Cloudify. I am getting the following error: : [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Nov 16:: 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. : /opt/manager/resources/deployments/default_tenant/923cbe8d-c30e-4c13-95de-cd1260dda2b6/tmpb2n01dut/lib/python3.6/site-packages/ansible/parsing/vault/init.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.

Following is my cloudify.yaml


description: >
  This blueprint creates an AWS infrastructure environment using Ansible.
  libselinux-python/libselinux-python3 on the manager VM is prerequisite.

imports:
  - https://raw.githubusercontent.com/cloudify-community/cloudify-catalog/6.4.0-build/tabs/utilities/eaas/custom_types.yaml
  - cloudify/types/types.yaml
  - plugin:cloudify-ansible-plugin

inputs:

  region_name:
    type: string
    default: EastUS
    display_label: Azure region name
    constraints:
      - valid_values:
          - BrazilSouth
          - FranceCentral
          - SouthAfricaNorth
          - AustraliaEast
          - CanadaCentral
          - GermanyWestCentral
          - CentralIndia
          - CentralUS
          - NorthEurope
          - JapanEast
          - EastUS
          - NorwayEast
          - KoreaCentral
          - EastUS2
          - UKSouth
          - SoutheastAsia
          - SouthCentralUS
          - WestEurope
          - EastAsia
          - USGovVirginia
          - SwedenCentral
          - ChinaNorth3
          - WestUS2
          - WestUS3

node_templates:

  #we creating the prefix for the deployment resources i.e. infrastructure
  infra_prefix:
    type: eaas.nodes.UniquePrefixGenerator
    properties:
      predefined_value: ""

  # Use ansible Executor node type in order to execute resources/ansible/playbook.yaml during install workflow.
  # See https://github.com/cloudify-cosmo/cloudify-ansible-plugin/blob/master/plugin.yaml for more information about the properties provided.
  install-infra-playbook:
    type: cloudify.nodes.ansible.Executor
    interfaces:
      cloudify.interfaces.lifecycle:
        create:
          implementation: ansible.playbook.execute
          inputs:
            env:
              ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3.8
    properties:
      playbook_path: playbooks/install_vpc.yaml
      sources: playbooks/inventory.yaml
      ansible_become: true
      run_data:
        resource_group_name: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_rg" ]}
        vpc_name: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_vpc" ]}
        subnet_name: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_subnet" ]}
        location: { get_input: region_name }
      ansible_env_vars: &env_vars
        AZURE_SUBSCRIPTION_ID: { get_secret: azure_subscription_id }
        AZURE_CLIENT_ID: { get_secret: azure_client_id }
        AZURE_SECRET: { get_secret: azure_client_secret }
        AZURE_TENANT: { get_secret: azure_tenant_id }

  # Override stop lifecycle interface for executing resources/ansible/uninstall-playbook.yaml playbook during uninstall workflow.
  # Execute ansible.cloudify_ansible.tasks.run task in order to do so.
  uninstall-infra-playbook:
    type: cloudify.nodes.Root
    interfaces:
      cloudify.interfaces.lifecycle:
        stop:
          implementation: ansible.cloudify_ansible.tasks.run
          inputs:
            playbook_path: playbooks/uninstall_vpc.yaml
            start_at_task: "Deleting resource group"
            sources: playbooks/inventory.yaml
            run_data:
              resource_group_name: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_rg" ]}
            ansible_env_vars: *env_vars

capabilities:

  resource_group_name:
    description: Created resource group name.
    value: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_rg" ]}

  vpc_name:
    description: Created VPC name.
    value: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_vpc" ]}

  subnet_name:
    description: Created subnet name.
    value: { concat: [ get_attribute: [ infra_prefix, value ], "cloudify_subnet" ]}

Inventory.yaml

all:
  hosts:
    localhost:
      ansible_connection: local
      ansible_python_interpreter: "{{ansible_playbook_python}}"

install_vpc.yaml

- hosts: all
  connection: local

  vars:
    resource_group: "{{ resource_group_name }}"
    vpc_name: "{{ vpc_name }}"
    subnet_name: "{{ subnet_name }}"

    vpcCidrBlock: '10.0.0.0/16'
    subNetCidrBlock: '10.0.1.0/24'

    state: 'present'
    location: "{{ azure_region }}"

  tasks:

    - name: Create a resource group
      azure_rm_resourcegroup:
        name: "{{ resource_group }}"
        location: "{{ location }}"
        state: "{{ state }}"

    - name: Create first virtual network
      azure_rm_virtualnetwork:
        resource_group: "{{ resource_group }}"
        name: "{{ vpc_name }}"
        address_prefixes: "{{ vpcCidrBlock }}"
        state: "{{ state }}"

    - name: Add subnet
      azure_rm_subnet:
        resource_group: "{{ resource_group }}"
        name: "{{ subnet_name }}"
        address_prefix: "{{ subNetCidrBlock }}"
        virtual_network: "{{ vpc_name }}"
        state: "{{ state }}"

0 Answers0