Skip to content

Remote python interpreter and OS detection regexp #97

@mpagot

Description

@mpagot

Ansible needs to know what is the Python interpreter to be used on any remote node. If none is specified, it just guess and report a Warning. The user can specify the interpreter to use as an inventory parameter:

all:
  children:
    hana:
      hosts:
        vmhana01:
          ansible_python_interpreter: /usr/bin/python3 

In qe-sap-deployment, ansible_python_interpreter is calculated by terraform by calculating the SLES version using regexp on the OS image from the cloud provider catalog. These regexps does not play well with SLE12 on some cloud providers.

https://openqaworker15.qa.suse.cz/tests/61565#step/deploy/4

ERROR    OUTPUT:          Error: Error in function call
ERROR    OUTPUT:          
ERROR    OUTPUT:            on main.tf line 58, in locals:
ERROR    OUTPUT:            58:   iscsi_major_version      = var.iscsi_os_major_version != "" ? var.iscsi_os_major_version : regex("[a-zA-Z]+:[a-zA-Z]+-[a-zA-Z]+-([0-9]+)-", local.iscsi_os_image)[0]
ERROR    OUTPUT:              �����������������
ERROR    OUTPUT:              � local.iscsi_os_image is "SUSE:sles-12-sp5-byos:gen1:2022.10.15"
ERROR    OUTPUT:          
ERROR    OUTPUT:          Call to function "regex" failed: pattern did not match any part of the given
ERROR    OUTPUT:          string.

with tfvars

vnet_address_range   = "10.10.0.0/16"
subnet_address_range = "10.10.1.0/24"
provisioner = "off"
bastion_enabled = false
hana_name = "vmhana"
hana_vm_size = "Standard_E4s_v3"
hana_count = "2"
az_region = "westeurope"
deployment_name = "qesapval61565"
os_image = "SUSE:sles-12-sp5-byos:gen1:2022.10.15"     
private_key = "/root/.ssh/id_rsa"
public_key = "/root/.ssh/id_rsa.pub"

Problematic line is os_image = "SUSE:sles-12-sp5-byos:gen1:2022.10.15"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions