Comment 3 for bug 1821045

Revision history for this message
John A Meinel (jameinel) wrote :

As a quick workaround hack you can use cloudinit-userdata. In my ~/.local/share/juju/clouds.yaml:
clouds:
...
  lxd:
    type: lxd
    auth-types: [certificate]
    endpoint: https://10.210.24.1:8443
    config:
      apt-http-proxy: http://192.168.0.50:3142
      apt-https-proxy: http://192.168.0.50:3142
      enable-os-upgrade: false
      cloudinit-userdata: |
          preruncmd:
              - "set -xe"
              - "curl -s http://192.168.0.50/v2/auth/store/assertions | sudo snap ack /dev/stdin"
              - "sudo snap set core proxy.store=yFsGTy6qwkrVISeJI1JjU09v9Uxlc0Gf"
      snap-store-proxy: "yFsGTy6qwkrVISeJI1JjU09v9Uxlc0Gf"
      snap-store-assertions: |
...

the "set -xe" isn't necessary, but it makes it possible to see that the next 2 commands are being run. When you use 'preruncmd' the values you set end up before *juju* calls 'set -xe' at the start of its normal runcmd. So while they are executed, without 'set -xe' you don't see them in /var/log/cloud-init-output.log.