Skip to content

Commit

Permalink
Enforces locale overrides on all playbooks
Browse files Browse the repository at this point in the history
Porting the locale override logic by @rmol to the usual medley of
SecureDrop prod playbooks. Correspondingly updates the config tests to
reuse the "all prod playbooks" lookup logic, so we're sure to retain
coverage into the future.

(cherry picked from commit c71bf16)
  • Loading branch information
Conor Schaefer authored and emkll committed Mar 14, 2019
1 parent a812741 commit b838cd3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions install_files/ansible-base/securedrop-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
hosts: securedrop_application_server
max_fail_percentage: 0
any_errors_fatal: yes
environment:
LC_ALL: C
roles:
- role: backup
tags: backup
Expand Down
2 changes: 2 additions & 0 deletions install_files/ansible-base/securedrop-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
become: yes
max_fail_percentage: 0
any_errors_fatal: yes
environment:
LC_ALL: C
vars:
log_paths_reference:
app:
Expand Down
2 changes: 2 additions & 0 deletions install_files/ansible-base/securedrop-restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
hosts: securedrop_application_server
max_fail_percentage: 0
any_errors_fatal: yes
environment:
LC_ALL: C
roles:
- role: restore
tags: restore
Expand Down
2 changes: 2 additions & 0 deletions install_files/ansible-base/securedrop-tails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
any_errors_fatal: yes
connection: local
gather_facts: yes
environment:
LC_ALL: C
roles:
- role: tails-config
tags: tails-config
Expand Down
5 changes: 1 addition & 4 deletions molecule/ansible-config/tests/test_play_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,11 @@ def test_any_errors_fatal(host, playbook):
assert play['any_errors_fatal']


@pytest.mark.parametrize('playbook', ['securedrop-prod.yml', 'securedrop-staging.yml'])
@pytest.mark.parametrize('playbook', find_ansible_playbooks())
def test_locale(host, playbook):
"""
The securedrop-prod and securedrop-staging playbooks should
control the locale in the host environment by setting LC_ALL=C.
TODO: evaluate whether to do the same for the rest of the
playbooks.
"""
with io.open(os.path.join(ANSIBLE_BASE, playbook), 'r') as f:
playbook_yaml = yaml.safe_load(f)
Expand Down

0 comments on commit b838cd3

Please sign in to comment.