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

(CONT-1119) Add puppet-strings #522

Merged
merged 1 commit into from
Aug 2, 2023
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
27 changes: 27 additions & 0 deletions .github/workflows/labeller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Labeller

on:
issues:
types:
- opened
- labeled
- unlabeled
pull_request_target:
types:
- opened
- labeled
- unlabeled

jobs:
label:
runs-on: ubuntu-latest
steps:

- uses: puppetlabs/[email protected]
name: Label issues or pull requests
with:
label_name: community
label_color: '5319e7'
org_membership: puppetlabs
fail_if_member: 'true'
token: ${{ secrets.IAC_COMMUNITY_LABELER }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ In this example the automated release prep workflow is triggered every Saturday
```yaml
---
networking:
ip: "172.16.254.254"
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
mac: "AA:AA:AA:AA:AA:AA"
ip: "172.16.254.254"
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
mac: "AA:AA:AA:AA:AA:AA"
is_pe: false
```

Expand Down
2 changes: 2 additions & 0 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ Gemfile:
version: '= 1.16.0'
- gem: 'rubocop-rspec'
version: '= 2.19.0'
- gem: 'puppet-strings'
version: '~> 3.0'
- gem: 'rb-readline'
version: '= 0.5.5'
platforms:
Expand Down
11 changes: 8 additions & 3 deletions moduleroot/spec/default_facts.yml.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% require 'yaml' -%>
# Use default_module_facts.yml for module specific facts.
#
# Facts specified here will override the values provided by rspec-puppet-facts.
Expand All @@ -6,9 +7,13 @@ networking:
ip: "<%= @configs['networking']['ip'] %>"
ip6: "<%= @configs['networking']['ip6'] %>"
mac: "<%= @configs['networking']['mac'] %>"

<% if @configs.dig('extra_facts', 'networking') -%>
<% @configs['extra_facts']['networking'].each do |k, v| -%>
<%=k%>: "<%= v %>"
<% end -%>
<% @configs['extra_facts'].delete('networking') -%>
<% end -%>
is_pe: <%= @configs['is_pe'] %>
<% if !@configs['extra_facts'].nil? -%>
<% require 'yaml' -%>
<% if @configs.dig('extra_facts') && !@configs['extra_facts'].empty? -%>
<%= @configs['extra_facts'].to_yaml[4..-1] %>
<% end -%>
2 changes: 1 addition & 1 deletion moduleroot/spec/spec_helper.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ default_fact_files.each do |f|
next unless File.exist?(f) && File.readable?(f) && File.size?(f)

begin
default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
rescue StandardError => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end
Expand Down