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

Refs #16134 - deploy hostname override fact #100

Merged
merged 1 commit into from
Sep 21, 2016
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
6 changes: 3 additions & 3 deletions manifests/rhsm_reconfigure_script.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
group => 'root',
mode => '0755',
}

concat::fragment { "${title}+script_start":
target => $title,
content => "#!/bin/bash\n\n",
order => '01',
}

concat::fragment { "${title}+default_ca_data":
target => $title,
content => "read -r -d '' KATELLO_DEFAULT_CA_DATA << EOM\n",
Expand All @@ -29,7 +29,7 @@
content => "EOM\n\n",
order => '04',
}

concat::fragment { "${title}+server_ca_data":
target => $title,
content => "read -r -d '' KATELLO_SERVER_CA_DATA << EOM\n",
Expand Down
5 changes: 5 additions & 0 deletions templates/rhsm-katello-reconfigure.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ fi
service goferd status >/dev/null && \
service goferd restart >/dev/null 2&>1


if [ -d /etc/rhsm/facts/ ]; then
echo "{\"network.hostname-override\":\"`hostname -f`\"}" > /etc/rhsm/facts/katello.facts
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we want to deploy this fact as 'fqdn' to match the katello-agent/sub-man plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for that was because facts in this directory override any generated facts. So if we used fqdn here, the plugin would never have affect, and future sub-mans would never have any affect. We want this 'hostname-override' fact to only affect the registration until a) the sub-man plugin is installed or b) future subman is installed which natively supports this fact.

Notice that the plugin only sets the fact if it doesn't already exist (so that the future sub-man's behavior takes priority).

Copy link
Member

Choose a reason for hiding this comment

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

Make sense. Last question, override makes some sense, however hostname -f is a valid value and fact. Would it be worth calling it hostname-full ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was meant more as a temporary workaround fact that only exists to help with issue. The fact it also never would actually be updated further reinforces to me that the name should indicate that its not a 'real' fact that should be depended on by users. I wouldn't want to see:

hostname: foo
fqdn: foo.example.com
hostname-full: someother.name.that.is.no.longer.valid

versus:
hostname-override: someother.name.that.is.no.longer.valid

not saying hostname-override is a fantastic name, but i figured it should not appear 'normal'.

fi

exit 0

# vim:sw=2:ts=2:et: