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

Take input of Sudo Password for CLI Commands #7799

Merged

Conversation

atultherajput
Copy link
Member

@atultherajput atultherajput commented Apr 3, 2023

πŸ”© Description: What code changed, and why?

Added sudo_password support for HA cmd in ruby

⛓️ Related Resources

https://chefio.atlassian.net/browse/CHEF-795
#7774

πŸ‘ Definition of Done

πŸ‘Ÿ How to Build and Test the Change

  • Rebuild automate-cli (rebuild components/automate-cli/) or can use (akrishna/automate-cli/0.1.0/20230412082516), automate-ha-cluster-ctl (rebuild components/automate-cluster-ctl/) or can use (akrishna/automate-ha-cluster-ctl/0.1.0/20230411133555), and automate-ha-deployment(rebuild components/automate-backend-deployment/) or can use (akrishna/automate-ha-deployment/0.1.0/20230411141141).
  • Upload the above packages hab pkg upload <PATH_TO_PACKAGE_HART_FILE>.
  • Create an airgap bundle with new packages sudo ./chef-automate airgap bundle create -m latest_semver.json --channel dev. Update this latest_semver.json manifest file with your origins.
    Note: Do not update the automate-cli origin in the manifest file, just install the new automate-cli on Bastion.
  • Set the environment variable sudo_password. For eg. export sudo_password=1234.
  • Run deployment command with -E flag to preserve environment variable. For eg. sudo -E ./chef-automate deploy config.toml --airgap-bundle automate-4.5.104.aib. Refer here for passing environment variables to the sudo command.

βœ… Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

πŸ“· Screenshots, if applicable

Screenshot 2023-04-12 at 1 42 43 PM

Screenshot 2023-04-12 at 1 41 54 PM

Video: https://progresssoftware.sharepoint.com/:v:/s/ChefCoreC/EacHYiZu7aFBgNkiBpoRPwkB0f_Ngkk_CR2vOxTCdbtMfA?e=janCk5

@netlify
Copy link

netlify bot commented Apr 3, 2023

βœ… Deploy Preview for chef-automate ready!

Name Link
πŸ”¨ Latest commit c8b45bd
πŸ” Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/6436c32df71e9e00081f8add
😎 Deploy Preview https://deploy-preview-7799--chef-automate.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the documentation Anything related to the Automate docs. label Apr 3, 2023
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
@atultherajput atultherajput force-pushed the CHEF-795-take-input-of-sudo-password-for-cli-commands branch from c20675f to 3ff1df7 Compare April 11, 2023 12:53
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Copy link
Collaborator

@punitmundra punitmundra left a comment

Choose a reason for hiding this comment

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

just make sure all pipeline will be green

Signed-off-by: dishanktiwari2501 <dtiwari@progress.com>
Copy link
Collaborator

@dishanktiwari2501 dishanktiwari2501 left a comment

Choose a reason for hiding this comment

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

Reviewed and updated the changes

@atultherajput
Copy link
Member Author

Hi @AnkurMundhra could you please review this ticket https://chefio.atlassian.net/browse/CHEF-795 ?

Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
Signed-off-by: Atul Krishna <Atul.Krishna@progress.com>
@vivek-yadav vivek-yadav merged commit 746e68e into main Apr 12, 2023
@vivek-yadav vivek-yadav deleted the CHEF-795-take-input-of-sudo-password-for-cli-commands branch April 12, 2023 14:51
@sonarcloud
Copy link

sonarcloud bot commented Apr 12, 2023

SonarCloud Quality Gate failed.Β  Β  Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
9.1% 9.1% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants