Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

General config cleanup throughout build logic #11

Merged
merged 8 commits into from
Apr 26, 2017
Merged

Conversation

conorsch
Copy link
Contributor

Updates the formatting within the dedicated OSSEC build role to make the task list more readable, intuitive, and DRY. Does not affect build functionality. All the changes here are cosmetic, intended to match the formatting best practices already implemented in the freedomofpress/securedrop repository, in preparation for merging this repo into that one (freedomofpress/securedrop#1468).

One change not included here is namespacing of the role default vars; something like securedrop_build_ossec seems appropriate, but that can be handled during repo merge.

Conor Schaefer added 8 commits April 25, 2017 21:54
These play-level vars should have been role defaults from the beginning,
but they're no longer used, so removing them from the repo.
The role requires these vars, but they're not available within the
context of the role. Let's move the vars into defaults, so they can be
sanely overridden at the site level. Doing so will keep the playbook
clean and neat in preparation for merging into the SecureDrop repo.
Reuse the apt cache for up to an hour, then refresh after that point.
Don't refresh the apt cache on every build run, since it's highly
unlikely that packages have changed. Additionally, use state=present for
packages, rather than state=latest, since the latter forces an apt cache
update every time.
Ansible is already smart enough to skip redownloading files via
`get_url` if the destination file exists. One must declare the fullpath
to the dest file, but we're already doing that. Unfortunately Ansible is
*not* smart enough to update dest files in place if the checksum doesn't
match, but that's why we have a hard fail on a subsequent task, to
handle the checksum verification.
Now looping over the dest paths with file state=absent, which keeps the
playbook output terser and makes the task list much more readable. Added
an explanatory comment for future maintainers; you're welcome, future
maintainer.
Mostly for consistency, but greatly adds in readability. The multiline
YAML format matches what's already used in the SecureDrop repo, so
making the change here in preparation for merging the repos.
Nicely formatted task names, including sentence capitalization and
punctuation. No functional changes. In a few tasks, consolidated
repetitive tasks with a `with_items` loop where appropriate.
@msheiny
Copy link
Contributor

msheiny commented Apr 26, 2017

👍 Nice clean-up task, successfully ran locally and got a tingling sensation. That means its working 😍

@msheiny msheiny merged commit 2267165 into master Apr 26, 2017
@msheiny msheiny deleted the general-cleanup branch April 26, 2017 13:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants