Skip to content

Commit

Permalink
Merge pull request #79 from cisagov/improvement/update_usage_of_ansib…
Browse files Browse the repository at this point in the history
…le-role-geoip2

Update the role for changes in `cisagov/ansible-role-geoip2`
  • Loading branch information
mcdonnnj authored Jul 9, 2024
2 parents c8811ae + 0400bab commit 2d902eb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ the repository's settings.

| Variable | Description | Default | Required |
|----------|-------------|---------|----------|
| cyhy_core_maxmind_license_key | The MaxMind license key that provides access to a GeoIP2 database subscription. | n/a | Yes |
| cyhy\_core\_install\_geoipupdate | Whether to install the MaxMind geoipupdate tool. | `false` | No |
| cyhy\_core\_maxmind\_account\_id | The MaxMind account ID for access to a GeoIP2 database subscription. | n/a | Yes |
| cyhy\_core\_maxmind\_license\_key | The MaxMind license key that provides access to a GeoIP2 database subscription. | n/a | Yes |

## Dependencies ##

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# This mirrors the default in cisagov/ansible-role-geoip2
cyhy_core_install_geoipupdate: false
1 change: 1 addition & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
ansible.builtin.include_role: # noqa var-naming[no-role-prefix]
name: ansible-role-cyhy-core
vars:
cyhy_core_maxmind_account_id: "{{ lookup('aws_ssm', '/cyhy/core/geoip/account_id', region='us-east-1') }}"
cyhy_core_maxmind_license_key: "{{ lookup('aws_ssm', '/cyhy/core/geoip/license_key', region='us-east-1') }}"
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
ansible.builtin.include_role:
name: geoip2
vars:
geoip2_install_geoipupdate: "{{ cyhy_core_install_geoipupdate }}"
geoip2_maxmind_account_id: "{{ cyhy_core_maxmind_account_id }}"
geoip2_maxmind_license_key: "{{ cyhy_core_maxmind_license_key }}"

- name: Install system versions of the Python packages that cyhy-core needs
Expand Down
7 changes: 5 additions & 2 deletions terraform/user.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module "user" {
aws.images-staging-ssm = aws
}

entity = "ansible-role-cyhy-core"
ssm_parameters = ["/cyhy/core/geoip/license_key"]
entity = "ansible-role-cyhy-core"
ssm_parameters = [
"/cyhy/core/geoip/account_id",
"/cyhy/core/geoip/license_key",
]
}

0 comments on commit 2d902eb

Please sign in to comment.