mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
test(packer): configure shared directory directly in the image.
This way, we do not always need to use vagrant to start a vm.
This commit is contained in:
parent
c707b730ef
commit
bac9658293
2
tests/Vagrantfile
vendored
2
tests/Vagrantfile
vendored
@ -26,7 +26,7 @@ Vagrant.configure("2") do |config|
|
|||||||
srv.vm.post_up_message = instance.to_yaml
|
srv.vm.post_up_message = instance.to_yaml
|
||||||
srv.vm.synced_folder '.', '/vagrant', disabled: true
|
srv.vm.synced_folder '.', '/vagrant', disabled: true
|
||||||
if !ENV['AA_INTEGRATION']
|
if !ENV['AA_INTEGRATION']
|
||||||
srv.vm.synced_folder '../', '/home/user/Projects/apparmor.d', type: 'virtiofs'
|
srv.vm.synced_folder '../', '/home/user/Projects/apparmor.d', type: 'virtiofs', mount: false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Configure Libvirt provider
|
# Configure Libvirt provider
|
||||||
|
@ -85,3 +85,9 @@ write_files:
|
|||||||
append: true
|
append: true
|
||||||
content: |
|
content: |
|
||||||
[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases
|
[[ -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
|
||||||
|
@ -86,3 +86,9 @@ write_files:
|
|||||||
append: true
|
append: true
|
||||||
content: |
|
content: |
|
||||||
[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases
|
[[ -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
|
||||||
|
@ -42,16 +42,8 @@ write_files:
|
|||||||
append: true
|
append: true
|
||||||
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
||||||
|
|
||||||
# Network configuration
|
# Setup shared directory
|
||||||
- path: /etc/systemd/network/20-wired.network
|
- path: /etc/fstab
|
||||||
owner: 'root:root'
|
append: true
|
||||||
permissions: '0644'
|
|
||||||
content: |
|
content: |
|
||||||
[Match]
|
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||||
Name=en*
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
DHCP=yes
|
|
||||||
|
|
||||||
[DHCPv4]
|
|
||||||
RouteMetric=10
|
|
||||||
|
@ -40,6 +40,12 @@ write_files:
|
|||||||
append: true
|
append: true
|
||||||
content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free
|
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
|
# Network configuration
|
||||||
- path: /etc/systemd/network/20-wired.network
|
- path: /etc/systemd/network/20-wired.network
|
||||||
owner: 'root:root'
|
owner: 'root:root'
|
||||||
|
@ -15,7 +15,7 @@ readonly SRC=/tmp/src
|
|||||||
readonly DISTRIBUTION
|
readonly DISTRIBUTION
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
install -dm0750 -o "$SUDO_USER" -g "$SUDO_USER" "/home/$SUDO_USER/Projects/" "/home/$SUDO_USER/.config/"
|
install -dm0750 -o "$SUDO_USER" -g "$SUDO_USER" "/home/$SUDO_USER/Projects/" "/home/$SUDO_USER/Projects/apparmor.d" "/home/$SUDO_USER/.config/"
|
||||||
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/.bash_aliases "/home/$SUDO_USER/.bash_aliases"
|
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/.bash_aliases "/home/$SUDO_USER/.bash_aliases"
|
||||||
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/monitors.xml "/home/$SUDO_USER/.config/monitors.xml"
|
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/monitors.xml "/home/$SUDO_USER/.config/monitors.xml"
|
||||||
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/htoprc "/home/$SUDO_USER/.config/htop/htoprc"
|
install -Dm0644 -o "$SUDO_USER" -g "$SUDO_USER" $SRC/htoprc "/home/$SUDO_USER/.config/htop/htoprc"
|
||||||
|
@ -27,7 +27,16 @@ packages:
|
|||||||
- rsync
|
- rsync
|
||||||
- vim
|
- vim
|
||||||
|
|
||||||
runcmd:
|
write_files:
|
||||||
|
|
||||||
# Set some bash aliases
|
# Set some bash aliases
|
||||||
- echo '[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases' >> /home/${username}/.bashrc
|
- path: /home/${username}/.bashrc
|
||||||
|
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
|
||||||
|
@ -65,6 +65,12 @@ runcmd:
|
|||||||
|
|
||||||
write_files:
|
write_files:
|
||||||
|
|
||||||
|
# Setup shared directory
|
||||||
|
- path: /etc/fstab
|
||||||
|
append: true
|
||||||
|
content: |
|
||||||
|
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||||
|
|
||||||
- path: /etc/systemd/network/20-wired.network
|
- path: /etc/systemd/network/20-wired.network
|
||||||
owner: 'root:root'
|
owner: 'root:root'
|
||||||
permissions: '0644'
|
permissions: '0644'
|
||||||
|
@ -65,6 +65,12 @@ runcmd:
|
|||||||
|
|
||||||
write_files:
|
write_files:
|
||||||
|
|
||||||
|
# Setup shared directory
|
||||||
|
- path: /etc/fstab
|
||||||
|
append: true
|
||||||
|
content: |
|
||||||
|
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||||
|
|
||||||
- path: /etc/systemd/network/20-wired.network
|
- path: /etc/systemd/network/20-wired.network
|
||||||
owner: 'root:root'
|
owner: 'root:root'
|
||||||
permissions: '0644'
|
permissions: '0644'
|
||||||
|
@ -33,6 +33,12 @@ packages:
|
|||||||
|
|
||||||
write_files:
|
write_files:
|
||||||
|
|
||||||
|
# Setup shared directory
|
||||||
|
- path: /etc/fstab
|
||||||
|
append: true
|
||||||
|
content: |
|
||||||
|
0a31bc478ef8e2461a4b1cc10a24cc4 /home/user/Projects/apparmor.d virtiofs defaults 0 1
|
||||||
|
|
||||||
# Network configuration
|
# Network configuration
|
||||||
- path: /etc/systemd/network/20-wired.network
|
- path: /etc/systemd/network/20-wired.network
|
||||||
owner: 'root:root'
|
owner: 'root:root'
|
||||||
|
Loading…
Reference in New Issue
Block a user