Public bug reported: Given user-data: #!/bin/bash snap install aws-cli --classic echo $PATH aws help # command shipped in the snap
We see the following failure in /var/log/cloud-init-output.log: Cloud-init v. 18.2 running 'modules:config' at Fri, 18 May 2018 20:10:57 +0000. Up 15.17 seconds. aws-cli 1.15.21 from 'aws' installed /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /var/lib/cloud/instance/scripts/part-001: line 5: aws: command not found Cloud-init v. 18.2 running 'modules:final' at Fri, 18 May 2018 20:11:05 +0000. Up 23.18 seconds. Expected results: commands shipped in snaps should work in user-data without hard-coded paths $ apt-cache policy cloud-init cloud-init: Installed: 18.2-27-g6ef92c98-0ubuntu1~18.04.1 Candidate: 18.2-27-g6ef92c98-0ubuntu1~18.04.1 Version table: *** 18.2-27-g6ef92c98-0ubuntu1~18.04.1 500 500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages 100 /var/lib/dpkg/status 18.2-14-g6d48d265-0ubuntu1 500 500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 Packages ** Affects: cloud-init (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1772107 Title: /snap/bin is not in path when executing user-data scripts To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1772107/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs