diff --git a/scripts/automationmodetool.expect b/scripts/automationmodetool.expect new file mode 100644 index 0000000..2248b66 --- /dev/null +++ b/scripts/automationmodetool.expect @@ -0,0 +1,6 @@ +#!/usr/bin/expect -f + +spawn automationmodetool enable-automationmode-without-authentication +expect "Enter the password for user 'admin':" +send "admin\n" +expect "Setting up machine to allow Automation Mode without requiring user authentication... succeeded." diff --git a/templates/base.pkr.hcl b/templates/base.pkr.hcl index 95f2b61..0de2517 100644 --- a/templates/base.pkr.hcl +++ b/templates/base.pkr.hcl @@ -102,4 +102,9 @@ build { "brew install awscli" ] } + + # Enable UI automation, see https://github.com/cirruslabs/macos-image-templates/issues/136 + provisioner "shell" { + script = "scripts/automationmodetool.expect" + } }