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

unable to provision a VM on GCP through ansible-playbook #23066

Open
0saurabh0 opened this issue Jun 14, 2024 · 2 comments
Open

unable to provision a VM on GCP through ansible-playbook #23066

0saurabh0 opened this issue Jun 14, 2024 · 2 comments
Assignees
Labels

Comments

@0saurabh0
Copy link

  1. Describe the issue you are having and what you expected to happen.
    Unable to provision/create a VM on GCP through ansible-playbook, throws an error python 3.8 or later is required
  1. Describe your environment, including
    • Version : Quinteros
    • Environment
      • For ManageIQ: using Docker
        Screenshot from 2024-06-13 18-27-05
@0saurabh0 0saurabh0 added the bug label Jun 14, 2024
@Fryguy Fryguy self-assigned this Jun 19, 2024
@Fryguy
Copy link
Member

Fryguy commented Jun 19, 2024

@0saurabh0 I see it says Docker so I wanted to confirm, are you using the monolithic docker image or the operator based deployment?

Also, would it be possible to share the ansible playbook you are using, or perhaps a reproducer?

@0saurabh0
Copy link
Author

@Fryguy I basically pulled the latest docker image as mentioned here.
also the playbook sort of looks like :

- name: Provision a GCP VM
  hosts: localhost
  gather_facts: false

  vars:
    gcp_project: velero-demo-418320 
    machine_type: "e2-medium"
    gcp_cred_kind: serviceaccount
    instance_name: "my-vm-instance"
    zone: "us-central1-a"
    region: "us-central1"
    machine_type: "e2-medium"
    image: "https://www.googleapis.com/compute/v1/projects/rocky-linux-cloud/global/images/rocky-linux-8-optimized-gcp-v20230411" 

  tasks:
    - name: Create an external address associated with the instance
      gcp_compute_address:
        name: "{{ zone }}-ip"
        region: "{{ region }}"
        project: "{{ gcp_project }}"
        service_account_file: "{{ gcp_cred_file }}"
        auth_kind: "{{ gcp_cred_kind }}"
      register: gce_ip

    - name: Create the GCP VM
      gcp_compute_instance:
        name: "{{ instance_name }}"
        machine_type: "{{ machine_type }}"
        zone: "{{ zone }}"
        project: "{{ gcp_project }}"
        service_account_file: "{{ gcp_cred_file }}"
        auth_kind: "{{ gcp_cred_kind }}"
        disks:
          - auto_delete: true
            boot: true
            initialize_params:
              source_image: "{{ image }}"
        network_interfaces:
          - access_configs: # if you don't add this then the VM instance will have no external address attached to it
              - name: External NAT
                nat_ip: "{{ gce_ip }}"
                type: ONE_TO_ONE_NAT
      register: result

    - name: Print the VM's IP address
      debug:
        var: gce_ip.address

and I am passing all the credentials through the key-value pair which is available while creating the catalog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants