mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
tests(packer): cleanup cloud init files.
This commit is contained in:
parent
c3c61a9270
commit
3fc4c29968
@ -55,25 +55,24 @@ packages:
|
||||
- terminator
|
||||
|
||||
runcmd:
|
||||
|
||||
# Regenerate grub.cfg
|
||||
- [ grub-mkconfig, -o, /boot/grub/grub.cfg ]
|
||||
- grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
# Remove swapfile
|
||||
- [ swapoff, -a ]
|
||||
- [ rm, -rf, /swap/ ]
|
||||
- [ sed, -e, "/swap/d", -i, /etc/fstab ]
|
||||
- swapoff -a
|
||||
- rm -rf /swap/
|
||||
- sed -e "/swap/d" -i /etc/fstab
|
||||
|
||||
# Enable core services
|
||||
- [ systemctl, enable, apparmor ]
|
||||
- [ systemctl, enable, auditd ]
|
||||
- [ systemctl, enable, gdm ]
|
||||
- [ systemctl, enable, NetworkManager ]
|
||||
- [ systemctl, enable, rngd ]
|
||||
- [ systemctl, enable, systemd-timesyncd.service ]
|
||||
- systemctl enable apparmor
|
||||
- systemctl enable auditd
|
||||
- systemctl enable gdm
|
||||
- systemctl enable NetworkManager
|
||||
- systemctl enable rngd
|
||||
- systemctl enable avahi-daemon
|
||||
- systemctl enable systemd-timesyncd.service
|
||||
|
||||
write_files:
|
||||
|
||||
# Enable AppArmor in kernel parameters
|
||||
- path: /etc/default/grub
|
||||
append: true
|
||||
|
@ -46,9 +46,10 @@ packages:
|
||||
# Install Graphical Interface
|
||||
- plasma-meta
|
||||
- sddm
|
||||
- ark
|
||||
- dolphin
|
||||
- konsole
|
||||
- ark
|
||||
- okular
|
||||
|
||||
# Install Applications
|
||||
- firefox
|
||||
@ -56,25 +57,24 @@ packages:
|
||||
- terminator
|
||||
|
||||
runcmd:
|
||||
|
||||
# Regenerate grub.cfg
|
||||
- [ grub-mkconfig, -o, /boot/grub/grub.cfg ]
|
||||
- grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
# Remove swapfile
|
||||
- [ swapoff, -a ]
|
||||
- [ rm, -rf, /swap/ ]
|
||||
- [ sed, -e, "/swap/d", -i, /etc/fstab ]
|
||||
- swapoff -a
|
||||
- rm -rf /swap/
|
||||
- sed -e "/swap/d" -i /etc/fstab
|
||||
|
||||
# Enable core services
|
||||
- [ systemctl, enable, apparmor ]
|
||||
- [ systemctl, enable, auditd ]
|
||||
- [ systemctl, enable, sddm ]
|
||||
- [ systemctl, enable, NetworkManager ]
|
||||
- [ systemctl, enable, rngd ]
|
||||
- [ systemctl, enable, systemd-timesyncd.service ]
|
||||
- systemctl enable apparmor
|
||||
- systemctl enable auditd
|
||||
- systemctl enable sddm
|
||||
- systemctl enable NetworkManager
|
||||
- systemctl enable rngd
|
||||
- systemctl enable avahi-daemon
|
||||
- systemctl enable systemd-timesyncd.service
|
||||
|
||||
write_files:
|
||||
|
||||
# Enable AppArmor in kernel parameters
|
||||
- path: /etc/default/grub
|
||||
append: true
|
||||
|
@ -37,37 +37,21 @@ packages:
|
||||
- wget
|
||||
|
||||
runcmd:
|
||||
|
||||
# Regenerate grub.cfg
|
||||
- [ grub-mkconfig, -o, /boot/grub/grub.cfg ]
|
||||
- grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
# Remove swapfile
|
||||
- [ swapoff, -a ]
|
||||
- [ rm, -rf, /swap/ ]
|
||||
- [ sed, -e, "/swap/d", -i, /etc/fstab ]
|
||||
- swapoff -a
|
||||
- rm -rf /swap/
|
||||
- sed -e "/swap/d" -i /etc/fstab
|
||||
|
||||
# Enable core services
|
||||
- [ systemctl, enable, apparmor ]
|
||||
- [ systemctl, enable, auditd ]
|
||||
- [ systemctl, enable, rngd ]
|
||||
- [ systemctl, enable, systemd-timesyncd.service ]
|
||||
- systemctl enable apparmor
|
||||
- systemctl enable auditd
|
||||
- systemctl enable rngd
|
||||
- systemctl enable systemd-timesyncd.service
|
||||
|
||||
write_files:
|
||||
|
||||
# Network configuration
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
||||
[Network]
|
||||
DHCP=yes
|
||||
|
||||
[DHCPv4]
|
||||
RouteMetric=10
|
||||
|
||||
# Enable AppArmor in kernel parameters
|
||||
- path: /etc/default/grub
|
||||
append: true
|
||||
@ -79,3 +63,23 @@ write_files:
|
||||
append: true
|
||||
content: |
|
||||
[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases
|
||||
|
||||
# Setup shared directory
|
||||
- path: /etc/fstab
|
||||
append: true
|
||||
content: |
|
||||
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||
|
||||
# Network configuration
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
||||
[Network]
|
||||
DHCP=yes
|
||||
|
||||
[DHCPv4]
|
||||
RouteMetric=10
|
||||
|
@ -145,9 +145,9 @@ trim() {
|
||||
truncate --size=0 /swap/swapfile
|
||||
fi
|
||||
|
||||
_msg "Fill root filesystem with 0 to reduce box size"
|
||||
dd if=/dev/zero of=/EMPTY bs=1M || true
|
||||
rm -f /EMPTY
|
||||
# _msg "Fill root filesystem with 0 to reduce box size"
|
||||
# dd if=/dev/zero of=/EMPTY bs=1M || true
|
||||
# rm -f /EMPTY
|
||||
|
||||
# Block until the empty file has been removed, otherwise, Packer will
|
||||
# try to kill the box while the disk is still full and that is bad.
|
||||
|
@ -37,15 +37,21 @@ runcmd:
|
||||
- apt-get install -y -t bookworm-backports golang-go
|
||||
|
||||
write_files:
|
||||
|
||||
# Add backports repository
|
||||
- path: /etc/apt/sources.list
|
||||
append: true
|
||||
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
||||
|
||||
# Setup shared directory
|
||||
- path: /etc/fstab
|
||||
append: true
|
||||
content: |
|
||||
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||
|
||||
# Network configuration
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
@ -37,7 +37,7 @@ runcmd:
|
||||
- apt-get install -y -t bookworm-backports golang-go
|
||||
|
||||
write_files:
|
||||
|
||||
# Add backports repository
|
||||
- path: /etc/apt/sources.list
|
||||
append: true
|
||||
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
||||
|
@ -35,7 +35,7 @@ runcmd:
|
||||
- apt-get install -y -t bookworm-backports golang-go
|
||||
|
||||
write_files:
|
||||
|
||||
# Add backports repository
|
||||
- path: /etc/apt/sources.list
|
||||
append: true
|
||||
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
||||
@ -48,8 +48,8 @@ write_files:
|
||||
|
||||
# Network configuration
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
@ -22,7 +22,7 @@ main() {
|
||||
install -Dm0644 $SRC/site.local /etc/apparmor.d/tunables/multiarch.d/site.local
|
||||
install -Dm0755 $SRC/aa-update /usr/bin/aa-update
|
||||
install -Dm0755 $SRC/aa-log-clean /usr/bin/aa-log-clean
|
||||
cat $SRC/parser.conf >> /etc/apparmor/parser.conf
|
||||
cat $SRC/parser.conf >>/etc/apparmor/parser.conf
|
||||
chown -R "$SUDO_USER:$SUDO_USER" "/home/$SUDO_USER/.config/"
|
||||
case "$DISTRIBUTION" in
|
||||
arch) pacman --noconfirm -U $SRC/*.pkg.tar.zst ;;
|
||||
|
@ -28,7 +28,6 @@ packages:
|
||||
- vim
|
||||
|
||||
write_files:
|
||||
|
||||
# Set some bash aliases
|
||||
- path: /home/${username}/.bashrc
|
||||
append: true
|
||||
|
@ -42,7 +42,6 @@ snap:
|
||||
- install snapd-desktop-integration
|
||||
|
||||
runcmd:
|
||||
|
||||
# Remove default filesystem and related tools not used with the suggested
|
||||
# storage layout. These may yet be required if different partitioning schemes
|
||||
# are used.
|
||||
@ -64,7 +63,6 @@ runcmd:
|
||||
- apt-get -y autoremove
|
||||
|
||||
write_files:
|
||||
|
||||
# Setup shared directory
|
||||
- path: /etc/fstab
|
||||
append: true
|
||||
@ -72,8 +70,8 @@ write_files:
|
||||
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
@ -42,7 +42,6 @@ snap:
|
||||
- install snapd-desktop-integration
|
||||
|
||||
runcmd:
|
||||
|
||||
# Remove default filesystem and related tools not used with the suggested
|
||||
# storage layout. These may yet be required if different partitioning schemes
|
||||
# are used.
|
||||
@ -64,7 +63,6 @@ runcmd:
|
||||
- apt-get -y autoremove
|
||||
|
||||
write_files:
|
||||
|
||||
# Setup shared directory
|
||||
- path: /etc/fstab
|
||||
append: true
|
||||
@ -72,8 +70,8 @@ write_files:
|
||||
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
@ -32,7 +32,6 @@ packages:
|
||||
- vim
|
||||
|
||||
write_files:
|
||||
|
||||
# Setup shared directory
|
||||
- path: /etc/fstab
|
||||
append: true
|
||||
@ -41,8 +40,8 @@ write_files:
|
||||
|
||||
# Network configuration
|
||||
- path: /etc/systemd/network/20-wired.network
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
owner: "root:root"
|
||||
permissions: "0644"
|
||||
content: |
|
||||
[Match]
|
||||
Name=en*
|
||||
|
Loading…
Reference in New Issue
Block a user