Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

[Backport 4.0] Fix Bootstrap on Centos 7 on GCP fails#651

Merged
loicalbertin merged 3 commits intorelease/4.0from
backport40/bugfix/GH-649_bootsrap_on_gcp_fails
May 27, 2020
Merged

[Backport 4.0] Fix Bootstrap on Centos 7 on GCP fails#651
loicalbertin merged 3 commits intorelease/4.0from
backport40/bugfix/GH-649_bootsrap_on_gcp_fails

Conversation

@loicalbertin
Copy link
Copy Markdown
Member

@loicalbertin loicalbertin commented May 26, 2020

Pull Request description

Description of the change

What I did

Update bootstrap tosca types with Forge PR ystia/forge#132

How to verify it

Bootstrap on with centos7 GCP

Description for the changelog

  • Bootstrap on Centos 7 on GCP fails (GH-649)

Applicable Issues

Fixes #649

Backports

Backport of #650

@laurentganne
Copy link
Copy Markdown
Contributor

Seeing this error during the bootstrap, will have a look:

    The task includes an option with an undefined variable. The error was: the inline if-expression on line 1 evaluated to false and no else section was defined.

    The error appears to have been in '/home/yorcuser/bootstrap/work/deployments/testtmp/overlay/org.ystia.ansible.linux.ansible/2.2.0-SNAPSHOT/playbooks/create.yml': line 59, column 7, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:


        - name: install Ansible using Pip
          ^ here

@loicalbertin
Copy link
Copy Markdown
Member Author

loicalbertin commented May 26, 2020

Also note that I have to document that epel repositories on Centos are now required for bootstrap Yorc.
That said it seems to work on CI.

@laurentganne
Copy link
Copy Markdown
Contributor

laurentganne commented May 26, 2020

The issue should be in org/ystia/ansible/linux/ansible/playbooks/create.yml
at :

extra_args: "{{ '--extra-index-url {}'.format(ANSIBLE_EXTRA_PACKAGE_REPOSITORY) if ANSIBLE_EXTRA_PACKAGE_REPOSITORY != ''}}"

Adding a else seems to fix the issue,
when using this definition for extra_args, it works:

extra_args: "{{ '--extra-index-url {}'.format(ANSIBLE_EXTRA_PACKAGE_REPOSITORY) if ANSIBLE_EXTRA_PACKAGE_REPOSITORY != ''  else ''}}"

@loicalbertin
Copy link
Copy Markdown
Member Author

Ok will add this but should be somehow dependent on a 3thd party lib as I tested it and it worked for me

@loicalbertin
Copy link
Copy Markdown
Member Author

Could you please port this change to the forge too?
Thanks

@laurentganne
Copy link
Copy Markdown
Contributor

Ok will add this but should be somehow dependent on a 3thd party lib as I tested it and it worked for me

I just pushed the change. Yes, I didn't find what in my setup produced a different behavior. This is a CentOS 7.8.2003 GCP VM created several months ago to perform bootstraps.

@laurentganne
Copy link
Copy Markdown
Contributor

Could you please port this change to the forge too?
Thanks

yes, will do

Copy link
Copy Markdown
Contributor

@laurentganne laurentganne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

Copy link
Copy Markdown
Contributor

@laurentganne laurentganne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (1.8.0_151) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

@loicalbertin loicalbertin merged commit 7ae5131 into release/4.0 May 27, 2020
@loicalbertin loicalbertin deleted the backport40/bugfix/GH-649_bootsrap_on_gcp_fails branch May 27, 2020 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants