generated from linux-system-roles/template
-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: Fixes for new pcs and ansible #223
Merged
richm
merged 6 commits into
linux-system-roles:main
from
tomjelinek:fixes-for-new-pcs-and-ansible
Aug 20, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9a3b8d7
fix: only set resource utilization when it is defined
tomjelinek 2cd253f
test: fix constraints test for pcs-0.12
tomjelinek 8116fae
test: remove jinja2 templating from an assert
tomjelinek b8a0d17
ci: update internal gitlab CI
tomjelinek 77dae04
refactor: replace deprecated filter password_hash
idevat 7080069
test: fix tests_cib_constraints_create formatting
tomjelinek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -23,14 +23,26 @@ | |||||||
|
||||||||
# The user is created by installing pacemaker packages. We just need to set the | ||||||||
# password. | ||||||||
- name: Set hacluster password | ||||||||
user: | ||||||||
name: hacluster | ||||||||
password: "{{ | ||||||||
ha_cluster_hacluster_password | string | | ||||||||
password_hash('sha512', ansible_hostname.replace('-', 'x')[:16]) }}" | ||||||||
- name: Provide a password for the hacluster user | ||||||||
when: | ||||||||
- ha_cluster_hacluster_password | string | length > 0 | ||||||||
block: | ||||||||
- name: Generate a password hash | ||||||||
# The arg `-6` means SHA512 based algorithms. | ||||||||
command: | ||||||||
cmd: >- | ||||||||
openssl passwd | ||||||||
-6 | ||||||||
-salt {{ ansible_hostname.replace('-', 'x') | quote }} | ||||||||
{{ ha_cluster_hacluster_password | string | quote }} | ||||||||
register: __ha_cluster_openssl_call_result | ||||||||
changed_when: false | ||||||||
no_log: true | ||||||||
|
||||||||
- name: Set hacluster password | ||||||||
user: | ||||||||
name: hacluster | ||||||||
password: "{{ __ha_cluster_openssl_call_result.stdout }}" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add no_log, but is it necessary? The password is not shown, the user module hides it even without no_log:
|
||||||||
|
||||||||
- name: Configure shell | ||||||||
include_tasks: shell_{{ ha_cluster_pacemaker_shell }}/configure-shell.yml # yamllint disable-line rule:line-length | ||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
No need to use
cmd
parameter hereThere 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.
Ansible supports providing the cmd parameter right with
command
, ifcmd
is the only parameter that you need to use.