Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow user defined RESOURCE_NAMESPACE #54

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -159,6 +159,13 @@ $ export MOLECULE_NO_LOG=False # not so verbose, helpful
$ export MOLECULE_DEBUG=True # very verbose, last ditch effort
```

You may also define a custom resource namespace by exposing the following
environment variables, for example in CI workflows:

```bash
$ export RESOURCE_NAMESPACE=e121dc64ff615ccdfac71bb5c00296b9 # Ensure the value length is <= 32
```

## Development

### Testing
Expand Down
2 changes: 1 addition & 1 deletion molecule_hetznercloud/playbooks/create.yml
Expand Up @@ -5,7 +5,7 @@
gather_facts: false
no_log: "{{ molecule_no_log }}"
vars:
resource_namespace: "{{ molecule_scenario_directory | md5 }}"
resource_namespace: "{{ lookup('ansible.builtin.env', 'RESOURCE_NAMESPACE') | default(molecule_scenario_directory | md5, true) }}"

ssh_port: 22
ssh_user: root
Expand Down
2 changes: 1 addition & 1 deletion molecule_hetznercloud/playbooks/destroy.yml
Expand Up @@ -5,7 +5,7 @@
gather_facts: false
no_log: "{{ molecule_no_log }}"
vars:
resource_namespace: "{{ molecule_scenario_directory | md5 }}"
resource_namespace: "{{ lookup('ansible.builtin.env', 'RESOURCE_NAMESPACE') | default(molecule_scenario_directory | md5, true) }}"
tasks:
- name: Populate the instance config
ansible.builtin.set_fact:
Expand Down