sr2c.terraform.sops_yaml_creation_rule module – Manage a .sops.yaml configuration file

Note

This module is part of the sr2c.terraform collection (version 1.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sr2c.terraform. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sr2c.terraform.sops_yaml_creation_rule.

Synopsis

  • Manages a .sops.yaml configuration file by allowing you to add/remove creation-rules.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.8

Parameters

Parameter

Comments

age

list / elements=string

A list of age public keys

exclusive

boolean

Remove every other creation rule from the file, so this rule is the only one.

Only used when state=present.

Choices:

  • false ← (default)

  • true

kms

list / elements=dictionary

A list of KMS options (refer to sops’ docs)

arn

string / required

The KMS key ARN

aws_profile

string

An optional profile name to use

context

dictionary

An optional AWS KMS encryption context, as a map of string keys and values.

role

string

An optional role to assume

path

path / required

The path to the .sops.yaml file

path_regex

string / required

The pattern to match when creating a file

pgp

list / elements=string

A list of PGP key ids

rule_id

string / required

A unique identifier for this creation_rule

state

string

Indicate desired state of the creation_rule

Choices:

  • "present" ← (default)

  • "absent"

Examples

- name: add foobar creation rule
  sops_yaml_creation_rule:
    path: ../.sops.yml
    rule_id: foobar
    state: present
    path_regex: projects/foobar/.*\.sops\.yml
    kms:
      - arn: arn:aws:kms:eu-west-1:1234:key/aaaaaaaaa-11111-bbbbb-ccccc-xyzabcdew
        aws_profile: foobar
    pgp:
      - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Authors