-
Notifications
You must be signed in to change notification settings - Fork 687
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
Control locale during Ansible runs #4252
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
--- | ||
- name: Ensure validation is run before prod install | ||
hosts: localhost | ||
environment: | ||
LC_ALL: C | ||
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. What do you think about validating that this variable is set (via 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. Rather than an assert statement, we can add a config test (to be run in CI) that confirms the environment is set as expected on every play. See here for an example: https://github.com/freedomofpress/securedrop/blob/10a2eeedc3c22fd39e6a7eda4ca8f4bca1ca6024/molecule/ansible-config/tests/test_max_fail_percentage.py 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. @rmol has already added the corresponding config test here, which will help guard against regressions in the future: if new plays are added without the explicit locale declaration, CI will report an error. |
||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
connection: local | ||
|
@@ -10,6 +12,8 @@ | |
|
||
- name: Prepare servers for installation | ||
hosts: securedrop | ||
environment: | ||
LC_ALL: C | ||
gather_facts: no | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
|
@@ -19,6 +23,8 @@ | |
|
||
- name: Add FPF apt repository and install base packages. | ||
hosts: securedrop | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
pre_tasks: | ||
|
@@ -49,6 +55,8 @@ | |
|
||
- name: Configure OSSEC. | ||
hosts: securedrop | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
roles: | ||
|
@@ -58,6 +66,8 @@ | |
|
||
- name: Configure mailing utilities. | ||
hosts: securedrop_monitor_server | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
roles: | ||
|
@@ -67,6 +77,8 @@ | |
|
||
- name: Configure SecureDrop Application Server. | ||
hosts: securedrop_application_server | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
roles: | ||
|
@@ -81,6 +93,8 @@ | |
# connection. After that point the admin will to proxy traffic over tor. | ||
- name: Lock down firewall configuration for Application and Monitor Servers. | ||
hosts: securedrop | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
roles: | ||
|
@@ -89,6 +103,8 @@ | |
|
||
- name: Reboot Application and Monitor Servers. | ||
hosts: securedrop | ||
environment: | ||
LC_ALL: C | ||
max_fail_percentage: 0 | ||
any_errors_fatal: yes | ||
vars: | ||
|
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.
Would it make sense to also apply these changes to
securedrop-staging.yml
?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.
Sure.
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.
Summarizing out of band discussion, we should also add the locale blocks to the other "prod" SD playbooks, such as
-logs
and-backup
. Technically only-logs
usesregister
, which is how we first encountered the error we're aiming to resolve here, but adding coverage to the other playbooks will also let us broaden the config test and reuse the existing "check all prod SD playbooks" logic.I'll tack on a commit to implement this before final review.