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

Feature/rs 165 tag further resources #260

Merged
merged 4 commits into from
Jun 27, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ vendor/
files/test
files/aws-tools/__pycache__
core
Gemfile.lock
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Adds tagging for snapshots from config

## [7.1.1] - 2023-10-23

Expand Down
1 change: 1 addition & 0 deletions data/author-primary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ author_primary::aem_id: author
author_primary::base_dir: "%{hiera('common::base_dir')}"
author_primary::tmp_dir: "%{hiera('common::tmp_dir')}"
author_primary::aws_region: "%{hiera('common::aws_region')}"
author_primary::aws_tags: "%{alias('common::aws_tags')}"

# device_alias <- used by snapshot_attach.py Depending on the block device driver of the kernel, the device could be attached with a different name than you specified.
author_primary::aem_repo_devices:
Expand Down
1 change: 1 addition & 0 deletions data/author-publish-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ author_publish_dispatcher::credentials_file: "%{hiera('common::credentials_file'
author_publish_dispatcher::publish_replication_agent_protocol: https
author_publish_dispatcher::publish_replication_agent_port: 5443
author_publish_dispatcher::aws_region: "%{hiera('common::aws_region')}"
author_publish_dispatcher::aws_tags: "%{alias('common::aws_tags')}"

# device_alias <- used by snapshot_attach.py Depending on the block device driver of the kernel, the device could be attached with a different name than you specified.
author_publish_dispatcher::aem_repo_devices:
Expand Down
1 change: 1 addition & 0 deletions data/author-standby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ author_standby::aem_id: author
author_standby::base_dir: "%{hiera('common::base_dir')}"
author_standby::tmp_dir: "%{hiera('common::tmp_dir')}"
author_standby::aws_region: "%{hiera('common::aws_region')}"
author_standby::aws_tags: "%{alias('common::aws_tags')}"

# device_alias <- used by snapshot_attach.py Depending on the block device driver of the kernel, the device could be attached with a different name than you specified.
author_standby::aem_repo_devices:
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ common::puppet_conf_dir: /etc/puppetlabs/puppet/
common::credentials_file: system-users-credentials.json
common::awslogs_service_name: awslogs
common::awslogs_config_path: /etc/awslogs/awslogs.conf
common::aws_tags: "%{alias('common::aws_tags')}"

common::aem_password_retrieval_command: "aws s3 cp s3://%{::data_bucket_name}/%{::stack_prefix}/system-users-credentials.json - | jq --raw-output .$aem_username"

Expand Down
1 change: 1 addition & 0 deletions data/preview-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ preview_publish::aem_id: publish
preview_publish::base_dir: "%{hiera('common::base_dir')}"
preview_publish::tmp_dir: "%{hiera('common::tmp_dir')}"
preview_publish::aws_region: "%{hiera('common::aws_region')}"
preview_publish::aws_tags: "%{alias('common::aws_tags')}"

# device_alias <- used by snapshot_attach.py Depending on the block device driver of the kernel, the device could be attached with a different name than you specified.
preview_publish::aem_repo_devices:
Expand Down
1 change: 1 addition & 0 deletions data/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ publish::aem_id: publish
publish::base_dir: "%{hiera('common::base_dir')}"
publish::tmp_dir: "%{hiera('common::tmp_dir')}"
publish::aws_region: "%{hiera('common::aws_region')}"
publish::aws_tags: "%{alias('common::aws_tags')}"

# device_alias <- used by snapshot_attach.py Depending on the block device driver of the kernel, the device could be attached with a different name than you specified.
publish::aem_repo_devices:
Expand Down
3 changes: 3 additions & 0 deletions manifests/author-primary.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$base_dir,
$tmp_dir,
$aws_region,
$aws_tags,
$aem_repo_devices,
$aem_password_retrieval_command,
$awslogs_config_path,
Expand Down Expand Up @@ -96,6 +97,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand All @@ -118,6 +120,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/author-publish-dispatcher.pp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand All @@ -158,6 +159,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand All @@ -180,6 +182,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/author-standby.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$aem_repo_devices,
$tmp_dir,
$aws_region,
$aws_tags,
$awslogs_config_path,
$author_primary_host = $::authorprimaryhost,
$component = $::component,
Expand Down Expand Up @@ -58,6 +59,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand All @@ -80,6 +82,7 @@
'component' => $component,
'stack_prefix' => $stack_prefix,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/preview-publish.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$exec_path,
$tmp_dir,
$aws_region,
$aws_tags,
$aem_repo_devices,
$aem_password_retrieval_command,
$volume_type,
Expand Down Expand Up @@ -205,6 +206,7 @@
'stack_prefix' => $stack_prefix,
'revert_snapshot_type' => $revert_snapshot_type,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
)
}
Expand All @@ -228,6 +230,7 @@
'stack_prefix' => $stack_prefix,
'revert_snapshot_type' => $revert_snapshot_type,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/publish.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$exec_path,
$tmp_dir,
$aws_region,
$aws_tags,
$aem_repo_devices,
$aem_password_retrieval_command,
$volume_type,
Expand Down Expand Up @@ -205,6 +206,7 @@
'stack_prefix' => $stack_prefix,
'revert_snapshot_type' => $revert_snapshot_type,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
)
}
Expand All @@ -228,6 +230,7 @@
'stack_prefix' => $stack_prefix,
'revert_snapshot_type' => $revert_snapshot_type,
'aws_region' => $aws_region,
'aws_tags' => $aws_tags,
}
),
}
Expand Down
3 changes: 3 additions & 0 deletions templates/aem-tools/live-snapshot-backup.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ else
--tag "StackPrefix=<%= $stack_prefix %>" \
--tag "SnapshotType=live" \
--tag "AemId=<%= $aem_repo_device['aem_id'] %>" \
<%- $aws_tags.each | Integer $index, Hash $aws_tag | { -%>
--tag "<%= $aws_tag['Key'] %>=<%= $aws_tag['Value'] %>" \
<%- } -%>
<%= $aem_repo_device['device_name'] %>)

translate_exit_code "$?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ else
--tag "StackPrefix=<%= $stack_prefix %>" \
--tag "SnapshotType=offline" \
--tag "AemId=<%= $aem_repo_device['aem_id'] %>" \
<%- $aws_tags.each | Integer $index, Hash $aws_tag | { -%>
--tag "<%= $aws_tag['Key'] %>=<%= $aws_tag['Value'] %>" \
<%- } -%>
<%= $aem_repo_device['device_name'] %>)

translate_exit_code "$?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ else
--tag "StackPrefix=<%= $stack_prefix %>" \
--tag "SnapshotType=offline" \
--tag "AemId=<%= $aem_repo_device['aem_id'] %>" \
<%- $aws_tags.each | Integer $index, Hash $aws_tag | { -%>
--tag "<%= $aws_tag['Key'] %>=<%= $aws_tag['Value'] %>" \
<%- } -%>
<%= $aem_repo_device['device_name'] %>)

translate_exit_code "$?"
Expand Down
3 changes: 3 additions & 0 deletions templates/aem-tools/offline-snapshot-backup-full-set.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ else
--tag "StackPrefix=<%= $stack_prefix %>" \
--tag "SnapshotType=offline" \
--tag "AemId=<%= $aem_repo_device['aem_id'] %>" \
<%- $aws_tags.each | Integer $index, Hash $aws_tag | { -%>
--tag "<%= $aws_tag['Key'] %>=<%= $aws_tag['Value'] %>" \
<%- } -%>
<%= $aem_repo_device['device_name'] %>)

translate_exit_code "$?"
Expand Down