userdata runcmd overwrites runcmd under cloud.cfg.d
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Undecided
|
Unassigned | ||
MAAS |
Invalid
|
Undecided
|
Unassigned | ||
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
I'm using Juju to deploy machine. Added runcmd section in /etc/cloud.
```
merge_how: 'list(append)
runcmd:
- echo "run in 60 my cloudinit cfg"
- usermod -aG docker ubuntu
merge_how: 'list(append)
```
This script works when deploy machine using MAAS. But it didn't work when deploy machine using JUJU, Seems merge_how doesn't works.
I want to use cloud-init single to seem how runcmd executes, but seems it's only displaying the last execution's status?
```
cloud-init single --name cc_runcmd --frequency always
Cloud-init v. 18.4-0ubuntu1~
```
Seems I didn't find a good way to debug this problem, appreciate any debug commands or tips for debug this kind of problems here.
description: | updated |
Changed in maas: | |
status: | New → Invalid |
Changed in juju: | |
status: | New → Invalid |
Could you guys please help figure out the overwriting rules used in juju user-data? cloud/instance/ scripts/ part-001` to customize juju deployed machine. But it's hack and not straight forward.
I tested `write_files` section defined under cloud.cfg.d/ is not override by juju user-data.
Currently I use `write_files` to write my scripts into `/var/lib/
``` cloud/instance/ user-data. txt.i "====== ======= ==0252242156900 375939= ="
# cat /var/lib/
Content-Type: multipart/mixed; boundary=
MIME-Version: 1.0
Number-Attachments: 1
--===== ======= ===025224215690 0375939= = Disposition: attachment; filename="part-001"
MIME-Version: 1.0
Content-Type: text/cloud-config
Content-
#cloud-config :http:: Proxy:: "127.0. 0.1" "DIRECT"; :https: :Proxy: :"127.0. 0.1" "DIRECT"; :ftp::Proxy: :"127.0. 0.1" "DIRECT"; :http:: Proxy:: "localhost" "DIRECT"; :https: :Proxy: :"localhost" "DIRECT"; :ftp::Proxy: :"localhost" "DIRECT"; :http:: Proxy:: "::1" "DIRECT"; :https: :Proxy: :"::1" "DIRECT"; :ftp::Proxy: :"::1" "DIRECT";' > /etc/apt/ apt.conf. d/95-juju- proxy-settings cloud-init- output. log' juju/MAASmachin e.txt' << 'EOF' juju/MAASmachin e.txt' system/ juju-clean- shutdown. service' encies= false final.target
apt_mirror: ""
bootcmd:
- |-
printf '%s\n' 'Acquire:
Acquire:
Acquire:
Acquire:
Acquire:
Acquire:
Acquire:
Acquire:
Acquire:
output:
all: '| tee -a /var/log/
package_update: true
package_upgrade: true
packages:
- bridge-utils
- curl
- cpu-checker
- bridge-utils
- cloud-utils
- tmux
- ubuntu-fan
runcmd:
- set -xe
- |-
mkdir -p '/var/lib/juju'
cat > '/var/lib/
'hostname: vm6
'
EOF
chmod 0755 '/var/lib/
- set -xe
- install -D -m 644 /dev/null '/etc/systemd/
- |-
printf '%s\n' '
[Unit]
Description=Stop all network interfaces on shutdown
DefaultDepend
After=
[Service] /sbin/ifdown -a -v --force t=tty
Type=oneshot
ExecStart=
StandardOutpu
StandardError=tty
[Install] final.target system/ juju-clean- shutdown. service' system/ juju-clean- shutdown. service' juju/nonce. txt' 0:a095a350- 3630-47f3- 8c0b-a49f741c7b f9' > '/var/lib/ juju/nonce. txt' FD}>&2) 2>/dev/null && exec PROGRESS_ FD}>&2 || JUJU_PROGRESS_FD=2 d/juju- proxy.sh ] || printf ''\n# Added by juju\n[ -f "/etc/juju- proxy.conf" proxy.conf" \n'' >> /etc/profile. d/juju- proxy.sh' lib/juju/ tools/2. 4.1.1-xenial- amd64'
WantedBy=
' > '/etc/systemd/
- /bin/systemctl enable '/etc/systemd/
- install -D -m 644 /dev/null '/var/lib/
- printf '%s\n' 'machine-
- test -n "$JUJU_PROGRESS_FD" || (exec {JUJU_PROGRESS_
{JUJU_
- '[ -e /etc/profile.
] && . "/etc/juju-
- mkdir -p /var/lib/juju/locks
- (id ubuntu &> /dev/null) && chown ubuntu:ubuntu /var/lib/juju/locks
- mkdir -p /var/log/juju
- chown syslog:adm /var/log/juju
- bin='/var/
- mkdir -p $bin
- echo 'Fetching Juju agent version 2.4.1.1 for amd64' >&$JUJU_PROGRESS_FD
- |2-
n=1
while true; do
printf "Attempt $n to download agent binaries from %s...\n" 'https:/ /10.10. 25.44:17070/ model/a8436d07- e82f-4ef0- 878c-d95d05f57a 13/tools/ 2.4.1.1- xenial- amd64'
curl -sSfw 'agent binaries from %{url_effective} downloaded: HTTP %{http_code}; time %{time_total}s; size %{size_download} bytes; speed %{speed_download} bytes/s ' --connect-timeout 20 --noproxy "*" --insecure -o $bin/tools....