Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Store the Docker Compose configuration in this project #8

Merged
merged 2 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions files/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
version: "3.2"

secrets:
aws_config:
file: secrets/aws_config
scan_read_creds:
file: secrets/scan_read_creds.yml

services:
update:
command:
- "--cc=ncats-dev@beta.dhs.gov,ncats@hq.dhs.gov"
- "--db-creds-file=/run/secrets/scan_read_creds.yml"
- "--from=reports@cyber.dhs.gov"
- "--html=body.html"
- "--log-level=info"
- "--reply=ncats-dev@beta.dhs.gov"
- >-
--subject="Latest list of web hosts that require authentication
via client certificates"
- "--text=body.txt"
- "--to=fnr.bod@hq.dhs.gov"
environment:
- AWS_CONFIG_FILE=/run/secrets/aws_config
- AWS_PROFILE=default
image: dhsncats/client-cert-update:0.0.2
secrets:
- source: aws_config
target: aws_config
- source: scan_read_creds
target: scan_read_creds.yml
12 changes: 8 additions & 4 deletions molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ def test_packages(host, directory):
assert oct(host.file(directory["path"]).mode) == directory["mode"]


@pytest.mark.parametrize("f", ["/var/cyhy/client-cert-update/docker-compose.yml"])
def test_command(host, f):
@pytest.mark.parametrize(
"file",
[{"path": "/var/cyhy/client-cert-update/docker-compose.yml", "mode": "0o644"}],
)
def test_command(host, file):
"""Test that appropriate files exist."""
assert host.file(f).exists
assert host.file(f).is_file
assert host.file(file["path"]).exists
assert host.file(file["path"]).is_file
assert oct(host.file(file["path"]).mode) == file["mode"]
10 changes: 4 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
state: directory
mode: 0755

- name: Download and untar the client-cert-update tarball
ansible.builtin.unarchive:
src: https://api.github.com/repos/cisagov/client-cert-update/tarball/develop
- name: Install the Docker Compose configuration
ansible.builtin.copy:
dest: /var/cyhy/client-cert-update
remote_src: yes
extra_opts:
- "--strip-components=1"
mode: 0644
src: docker-compose.yml