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

Add trusted_node_data = true to puppet config during reconfigure. #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nuclearsandwich
Copy link
Contributor

ros-infrastructure/buildfarm_deployment#211 adds some puppet that uses facts from local node data. This configuration directive is required to do so.

@@ -23,6 +23,16 @@ elif [[ $# -eq 0 ]] && [[ ! -f "${script_dir}/role" ]]; then
usage
fi

# Confirm that node-specific facts are usable.
if ! grep -q '^trusted_node_data ?= ?true' /etc/puppet/puppet.conf; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the check for optional space before and after the = is not working (if you run twice the whole bash code you end up with the command inserted twice). This should work the grep pattern:

Suggested change
if ! grep -q '^trusted_node_data ?= ?true' /etc/puppet/puppet.conf; then
if ! grep -q ''^trusted_node_data[[:space:]]*=[[:space:]]*true'' /etc/puppet/puppet.conf; then
``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some power to doubled single-quotes that I'm not aware of? Or is that part of the suggestion a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also may just need the Extended Regular Expression engine.

Suggested change
if ! grep -q '^trusted_node_data ?= ?true' /etc/puppet/puppet.conf; then
if ! grep -Eq '^trusted_node_data ?= ?true' /etc/puppet/puppet.conf; then

Would you give that a try @j-rivero?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants