-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add code to encode,decode opensearch and postgres passwords #8783
base: main
Are you sure you want to change the base?
Conversation
π· Deploy Preview for chef-automate processing.
|
func (p *PullConfigsImpl) getAwsOSPassword() (string, error) { | ||
for _, ip := range p.infra.Outputs.AutomatePrivateIps.Value { | ||
if stringutils.SliceContains(p.exceptionIps, ip) { | ||
continue | ||
} | ||
p.sshUtil.getSSHConfig().hostIP = ip | ||
rawOutput, err := p.sshUtil.connectAndExecuteCommandOnRemote(GET_AWS_OS_PASSWORD, true) | ||
if err != nil { | ||
return "", err | ||
} | ||
return strings.TrimSpace(rawOutput), nil | ||
} | ||
return "", nil | ||
|
||
} | ||
|
||
func (p *PullConfigsImpl) getPGSuperUserPassword() (string, error) { | ||
for _, ip := range p.infra.Outputs.AutomatePrivateIps.Value { | ||
if stringutils.SliceContains(p.exceptionIps, ip) { | ||
continue | ||
} | ||
p.sshUtil.getSSHConfig().hostIP = ip | ||
rawOutput, err := p.sshUtil.connectAndExecuteCommandOnRemote(GET_PG_SUPERUSER_PASSWORD, true) | ||
if err != nil { | ||
return "", err | ||
} | ||
return strings.TrimSpace(rawOutput), nil | ||
} | ||
return "", nil | ||
|
||
} | ||
|
||
func (p *PullConfigsImpl) getPGDBUserPassword() (string, error) { | ||
for _, ip := range p.infra.Outputs.AutomatePrivateIps.Value { | ||
if stringutils.SliceContains(p.exceptionIps, ip) { | ||
continue | ||
} | ||
p.sshUtil.getSSHConfig().hostIP = ip | ||
rawOutput, err := p.sshUtil.connectAndExecuteCommandOnRemote(GET_PG_DBUSER_PASSWORD, true) | ||
if err != nil { | ||
return "", err | ||
} | ||
return strings.TrimSpace(rawOutput), nil | ||
} | ||
return "", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeatative functions can be reused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -392,7 +392,7 @@ if [ -e "/hab/user/deployment-service/config/user.toml" ]; then | |||
chef-automate upgrade run --airgap-bundle ${frontend_aib_file} | |||
|
|||
wait_for_upgrade | |||
|
|||
chef-automate decode-password /etc/chef-automate/config.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep this path in a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
0a0d3e0
to
843c55c
Compare
Signed-off-by: Rensy Thomas <[email protected]>
843c55c
to
c3a48eb
Compare
|
Signed-off-by: Rensy Thomas <[email protected]>
π© Description: What code changed, and why?
βοΈ Related Resources
π Definition of Done
π How to Build and Test the Change
β Checklist
All PRs must tick these:
With occasional exceptions, all PRs from Progress employees must tick these:
make spell
in any component directory)All PRs from Progress employees should tick these if appropriate:
Please add a note next to any checkbox above if you are NOT ticking it.
π· Screenshots, if applicable
Recording is attached in https://progresssoftware.atlassian.net/browse/CHEF-17454