-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjuju.yaml
75 lines (63 loc) · 2.41 KB
/
juju.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package_update: true
packages:
- python3-pip
- jq
- tox
- gnome-keyring
bootcmd:
- printf "[Resolve]\nDNS=1.1.1.1\n" > /etc/systemd/resolved.conf
- [systemctl, restart, systemd-resolved]
snap:
commands:
- snap install multipass-sshfs
# - snap install lxd --channel=5.0/stable
- snap install juju --channel=3.5/stable
- snap install charmcraft --classic --channel=latest/stable
# sudo snap refresh charmcraft --classic --channel=2.x/stable
# -- https://snapcraft.io/jhack
# - snap install jhack
# - snap connect jhack:dot-local-share-juju snapd
# - snap connect jhack:ssh-read snapd
# -- Update charms
# - snap refresh
runcmd:
- DEBIAN_FRONTEND=noninteractive apt -y upgrade
- |
# Create symlink for compatibility but mount inside home so that juju snap can access
ln -sf /home/ubuntu/vagrant /vagrant
- |
# disable swap
sysctl -w vm.swappiness=0
echo "vm.swappiness = 0" | tee -a /etc/sysctl.conf
swapoff -a
- |
# disable unnecessary services
systemctl disable man-db.timer man-db.service --now
systemctl disable apport.service apport-autoreport.service --now
systemctl disable apt-daily.service apt-daily.timer --now
systemctl disable apt-daily-upgrade.service apt-daily-upgrade.timer --now
systemctl disable unattended-upgrades.service --now
systemctl disable motd-news.service motd-news.timer --now
systemctl disable bluetooth.target --now
systemctl disable ua-messaging.service ua-messaging.timer --now
systemctl disable ua-timer.timer ua-timer.service --now
systemctl disable systemd-tmpfiles-clean.timer --now
- |
# apt cleanup
apt remove -y landscape-client landscape-common
apt-get autoremove -y
- |
adduser ubuntu lxd
- |
# setup charmcraft
lxd init --auto
# lxd init --auto --storage-backend zfs --storage-create-loop 30 --storage-pool lxd
# lxc network set lxdbr0 ipv6.address none
- |
# Make sure juju directory is there
sudo -u ubuntu python3 -m pip install --user uv
sudo -u ubuntu mkdir -p /home/ubuntu/.local/share/juju
sudo -u ubuntu HOME=/home/ubuntu juju
sudo -u ubuntu bash -c "echo alias watch-juju=\'juju status --watch 3s --storage\' >> /home/ubuntu/.bashrc"
sudo -u ubuntu bash -c "echo '[ -z "\$TMUX" ] && exec tmux new-session -A -s workspace' >> /home/ubuntu/.bashrc"
final_message: "The system is finally up, after $UPTIME seconds"