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
(BOLT-702) Install puppet agent on osx #307
Conversation
tasks/shell.sh
Outdated
fi | ||
|
||
# Random function since not all shells have $RANDOM | ||
if exists hexdump; then | ||
random_number=random_hexdump | ||
random_number=$(random_hexdump) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was adding the string "random_hexdump" to the path instead of a random number.
tasks/shell.sh
Outdated
@@ -250,12 +249,17 @@ random_hexdump () { | |||
if test "x$TMPDIR" = "x"; then | |||
tmp="/tmp" | |||
else | |||
tmp=$TMPDIR | |||
tmp=${TMPDIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Vmpooler the TMPDIR environment variable had a trailing /
.
I have tested on Vmpooler osx-1011-x86_64, osx-1012-x86_64, osx-1013-x86_64 with both Also, it appears puppetlabs-puppet_agent/tasks/shell.sh Line 351 in 73c71c8
|
CLA signed by all contributors. |
This comment has been minimized.
This comment has been minimized.
50886c8
to
f27eafd
Compare
Added acceptance tests targets for vmpooler. They can be run "manually" with proper beaker credentials. Setup
Example invocation
|
@@ -147,9 +159,10 @@ def bolt_on(target, type, action, object, | |||
File.open(inventory_path, 'w') {|fh| fh.write(inventory.to_json)} | |||
File.open(config_path, 'w') {|fh| fh.write("---\n")} | |||
command += ['--inventoryfile', inventory_path] | |||
command += ['--configfile', inventory_path] | |||
command += ['--configfile', config_path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this set to inventory_path
on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
keys = host.connection.instance_variable_get(:@ssh).options[:keys] | ||
key = keys.first if keys | ||
config[:ssh][:"private-key"] = key if key | ||
node_name = host.hostname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably still build node_name = "ssh://#{host.host_hash[:ip]}?n=#{host.hostname}"
@@ -50,8 +51,20 @@ def add_node(node, group_name, groups) | |||
config: config | |||
} | |||
else | |||
# This is very unlikely to work | |||
node_name, node = host.hostname | |||
# host_hash is differnet depending on hypervisor (docker vs vmpooler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we decide how to process the host_hash with a conditional on the hypervisor directly
@@ -147,9 +159,10 @@ def bolt_on(target, type, action, object, | |||
File.open(inventory_path, 'w') {|fh| fh.write(inventory.to_json)} | |||
File.open(config_path, 'w') {|fh| fh.write("---\n")} | |||
command += ['--inventoryfile', inventory_path] | |||
command += ['--configfile', inventory_path] | |||
command += ['--configfile', config_path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
tasks/install_shell.sh
Outdated
"10.6") platform_version="10.6" ;; | ||
"10.7"|"10.8"|"10.9") platform_version="10.7" ;; | ||
*) echo "No builds for platform: $major_version" | ||
"10.6"|"10.7"|"10.8"|"10.9"|"10.10") echo "No builds for platform: $major_version" | ||
report_bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably leave this out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave out report_bug? Or the version check in general?
tasks/install_shell.sh
Outdated
@@ -409,8 +413,16 @@ do_download() { | |||
unable_to_retrieve_package | |||
} | |||
|
|||
latest_version() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we name this function to make it clear it's for osx
Updated. |
CLA signed by all contributors. |
Support puppet-agent install on macOS 11, 12, and 13. Logic is based on the PE install script.
Fixed. |
Are we planning on utilizing the
|
I get a bunch of extraneous non-JSON output. Is that expected?
|
@nicklewis I think showing the output is expected. This mimics the behavior of the task output when run against a linux target.
|
I'll go ahead and remove do_checksum. |
@nicklewis it's not ideal but I think it will take a new ticket to make this capture output and generate json robustly. |
if exists sha256sum; then | ||
checksum=`sha256sum $1 | awk '{ print $1 }'` | ||
if test "x$checksum" != "x$2"; then | ||
checksum_mismatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove checksum_mismatch
as well.
puppetlabs-puppet_agent/tasks/install_shell.sh
Lines 234 to 238 in fa0c9e2
checksum_mismatch() { | |
critical "Package checksum mismatch!" | |
report_bug | |
exit 1 | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Previously any Beaker version 3+ was supported. However Beaker 4 was just released and removes many previously integrated gems. Stick to Beaker 3 until we can figure out which ones explicitly need to be pulled in.
Remove unused shell functions do_checksum and checksum_mismatch from the install task.
Support puppet-agent install on osx 11,12,13. Logic is based on https://github.com/puppetlabs/puppetlabs-pe_repo/blob/hoyt/templates/osx.bash.erb#L5