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

azure_rm_webapp - Can't create Web App with Java11 or Java17 #1233

Closed
sameer-mandaokar opened this issue Aug 2, 2023 · 2 comments · Fixed by #1495
Closed

azure_rm_webapp - Can't create Web App with Java11 or Java17 #1233

sameer-mandaokar opened this issue Aug 2, 2023 · 2 comments · Fixed by #1495
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority

Comments

@sameer-mandaokar
Copy link

sameer-mandaokar commented Aug 2, 2023

SUMMARY

Can't create Azure Web App with Java11 or Java17 as required version via Ansible.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm_webapp

ANSIBLE VERSION

ansible [core 2.12.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/smandaokar/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/smandaokar/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True

COLLECTION VERSION

smandaokar@SMANDAOKAR2L:/mnt/d/R_F_S/projects/wnc-rfs-ansible$ ansible-galaxy collection list azure.azcollection

# /usr/lib/python3/dist-packages/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 1.13.0

# /home/smandaokar/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 1.16.0

CONFIGURATION

CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = ['ansible.posix.profile_tasks']
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml

OS / ENVIRONMENT
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
STEPS TO REPRODUCE
  1. Login to your Ubuntu Linux via shell
  2. It is expected to have access for Azure portal and any subscription.
  3. Under your subscription, you should have resource group and one service principal created inside it.
  4. From your Ubuntu Linux export below environment variables -
export AZURE_SUBSCRIPTION_ID=<enter-your-azure-subscription-id>
export AZURE_CLIENT_ID=<enter-your-azure-service-principal-id>
export AZURE_SECRET=<enter-your-ecret-for-azure-service-principal>
export AZURE_TENANT=<enter-your-tenant-id>
  1. Under any given director create file named 'configure-appservice.yml' and copy below content inside it.
- hosts: localhost
  connection: local
  gather_facts: yes
  collections:
   - azure.azcollection
  vars:
    resource_group: sameerma
    webapp_name: wncrfs-ansible-java11
    plan_name: wncrfs-ansible-asp
    location: eastus  
  tasks:
    - name: "01: Azure Resource Group Creation"
      azure_rm_resourcegroup:
        name: "sameerma"
        location: "eastus"

    - name: "02: Azure App Service creation"
      azure_rm_webapp:
        resource_group: "{{ resource_group }}"
        name: "{{ webapp_name }}"
        plan:
          resource_group: "{{ resource_group }}"
          name: "{{ plan_name }}"
          is_linux: true
          sku: P1v3
          number_of_workers: 1
        frameworks:
          - name: "java"
            version: "11"
  1. Execute ansible-playbook with below command -

ansible-playbook configure-appservice.yml -vvvv

EXPECTED RESULTS

Successful execution of Ansible playbook which should create Azure App Service at specified resource group.

ACTUAL RESULTS

smandaokar@SMANDAOKAR2L:/mnt/d/R_F_S/projects/wnc-rfs-ansible$ ansible-playbook configure-rfs.yml -vvvv
[WARNING]: Ansible is being run in a world writable directory (/mnt/d/R_F_S/projects/wnc-rfs-ansible), ignoring it as an
ansible.cfg source. For more information see https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-
in-world-writable-dir
ansible-playbook [core 2.12.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/smandaokar/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/smandaokar/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callbacks_enabled
instead. This feature will be removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Loading collection azure.azcollection from /home/smandaokar/.ansible/collections/ansible_collections/azure/azcollection
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Loading collection community.general from /usr/lib/python3/dist-packages/ansible_collections/community/general
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Loading callback plugin community.general.yaml of type stdout, v2.0 from /usr/lib/python3/dist-packages/ansible_collections/community/general/plugins/callback/yaml.py
Loading collection ansible.posix from /usr/lib/python3/dist-packages/ansible_collections/ansible/posix
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Loading callback plugin ansible.posix.profile_tasks of type aggregate, v2.0 from /usr/lib/python3/dist-packages/ansible_collections/ansible/posix/plugins/callback/profile_tasks.py

PLAYBOOK: configure-rfs.yml ************************************************************************************************
Positional arguments: configure-rfs.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in configure-rfs.yml

PLAY [localhost] ***********************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************
task path: /mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:1
Wednesday 02 August 2023  14:23:46 +0530 (0:00:00.022)       0:00:00.022 ******
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: smandaokar
<127.0.0.1> EXEC /bin/sh -c 'echo ~smandaokar && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/smandaokar/.ansible/tmp `"&& mkdir "` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039 `" && echo ansible-tmp-1690966426.5511057-3967-16343512887039="` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py
<127.0.0.1> PUT /home/smandaokar/.ansible/tmp/ansible-local-3962_cc16gum/tmply05cjgm TO /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039/AnsiballZ_setup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039/ /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039/AnsiballZ_setup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/smandaokar/.ansible/tmp/ansible-tmp-1690966426.5511057-3967-16343512887039/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [01: Azure Resource Group Creation] ***********************************************************************************
task path: /mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:12
Wednesday 02 August 2023  14:23:47 +0530 (0:00:00.986)       0:00:01.008 ******
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: smandaokar
<127.0.0.1> EXEC /bin/sh -c 'echo ~smandaokar && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/smandaokar/.ansible/tmp `"&& mkdir "` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635 `" && echo ansible-tmp-1690966427.5260875-4098-91987489204635="` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635 `" ) && sleep 0'
Using module file /home/smandaokar/.ansible/collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup.py
<127.0.0.1> PUT /home/smandaokar/.ansible/tmp/ansible-local-3962_cc16gum/tmpl8_zxasj TO /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635/AnsiballZ_azure_rm_resourcegroup.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635/ /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635/AnsiballZ_azure_rm_resourcegroup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635/AnsiballZ_azure_rm_resourcegroup.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/smandaokar/.ansible/tmp/ansible-tmp-1690966427.5260875-4098-91987489204635/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => changed=false
  contains_resources: true
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      append_tags: true
      auth_source: auto
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      force_delete_nonempty: false
      location: eastus
      log_mode: null
      log_path: null
      name: sameerma
      password: null
      profile: null
      secret: null
      state: present
      subscription_id: null
      tags: null
      tenant: null
      thumbprint: null
      x509_certificate_path: null
  state:
    id: /subscriptions/53e91d25-daae-4911-b7b7-8aaeca0c54f0/resourceGroups/sameerma
    location: eastus
    name: sameerma
    provisioning_state: Succeeded
    tags:
      Created By: smandaokar@ptc.com
      Owner: smandaokar@ptc.com
      Purpose: Innovation

TASK [02: Azure App Service creation] **************************************************************************************
task path: /mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:17
Wednesday 02 August 2023  14:23:49 +0530 (0:00:02.479)       0:00:03.488 ******
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: smandaokar
<127.0.0.1> EXEC /bin/sh -c 'echo ~smandaokar && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/smandaokar/.ansible/tmp `"&& mkdir "` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526 `" && echo ansible-tmp-1690966430.0077994-4125-67074679680526="` echo /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526 `" ) && sleep 0'
Using module file /home/smandaokar/.ansible/collections/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp.py
<127.0.0.1> PUT /home/smandaokar/.ansible/tmp/ansible-local-3962_cc16gum/tmp0hj0ae3b TO /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526/AnsiballZ_azure_rm_webapp.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526/ /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526/AnsiballZ_azure_rm_webapp.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526/AnsiballZ_azure_rm_webapp.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/smandaokar/.ansible/tmp/ansible-tmp-1690966430.0077994-4125-67074679680526/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => changed=false
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      always_on: null
      api_profile: latest
      app_settings: null
      app_state: started
      append_tags: true
      auth_source: auto
      cert_validation_mode: null
      client_affinity_enabled: true
      client_id: null
      cloud_environment: AzureCloud
      container_settings: null
      deployment_source: null
      frameworks:
      - name: java
        settings: null
        version: '11'
      ftps_state: null
      https_only: null
      location: null
      log_mode: null
      log_path: null
      min_tls_version: null
      name: wncrfs-ansible-java11
      password: null
      plan:
        is_linux: true
        name: wncrfs-ansible-asp
        number_of_workers: 1
        resource_group: sameerma
        sku: P1v3
        subscription_id: 53e91d25-daae-4911-b7b7-8aaeca0c54f0
      profile: null
      purge_app_settings: false
      resource_group: sameerma
      scm_type: null
      secret: null
      startup_file: null
      state: present
      subscription_id: null
      tags: null
      tenant: null
      thumbprint: null
      x509_certificate_path: null
  msg: Linux web app only supports java 8.

PLAY RECAP *****************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Wednesday 02 August 2023  14:23:53 +0530 (0:00:03.902)       0:00:07.390 ******
===============================================================================
02: Azure App Service creation -------------------------------------------------------------------------------------- 3.90s
/mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:17 ----------------------------------------------------------------
01: Azure Resource Group Creation ----------------------------------------------------------------------------------- 2.48s
/mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:12 ----------------------------------------------------------------
Gathering Facts ----------------------------------------------------------------------------------------------------- 0.99s
/mnt/d/R_F_S/projects/wnc-rfs-ansible/configure-rfs.yml:1 -----------------------------------------------------------------

@Fred-sun
Copy link
Collaborator

Fred-sun commented Aug 3, 2023

@sameer-mandaokar Thank you for reporting this issue, we are working on it, thank you!

@Fred-sun Fred-sun added medium_priority Medium priority work in In trying to solve, or in working with contributors bug Something isn't working labels Aug 3, 2023
@Fred-sun
Copy link
Collaborator

@sameer-mandaokar Added in #1495

@Fred-sun Fred-sun added has_pr PR fixes have been made and removed work in In trying to solve, or in working with contributors labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants