Browse Source

fix network activation at reboot and disable network configuration for debian image

master
Antoine 2 months ago
parent
commit
e58efdb5ad
Signed by: antoine <antoinroux@hotmail.fr> GPG Key ID: 098FB66FC0475E70
4 changed files with 24 additions and 6 deletions
  1. +4
    -4
      docker-compose.yml
  2. +1
    -0
      image/assets/ansible/playbook-debian.yml
  3. +7
    -1
      image/assets/ansible/roles/debian-init/defaults/main.yml
  4. +12
    -1
      image/assets/ansible/roles/debian-init/tasks/main.yml

+ 4
- 4
docker-compose.yml View File

@@ -1,4 +1,4 @@
version: '3.7'
version: "3.7"

services:
gentoo_packer:
@@ -16,7 +16,7 @@ services:
- "./image/assets:/packer"
- "./image/cache:/packer-cache"
ports:
- "5900:5900"
- "5900:5900"

debian_packer:
image: ${REGISTRY_URL}/${IMAGE_NAME}:${VERSION}
@@ -26,7 +26,7 @@ services:
- SSH_LIVE_USERNAME=debian
- SSH_LIVE_PASSWORD=debian
- IMAGE_VERSION=10.7.0
- ANSIBLE_EXTRA_VARS=generated_user=antoine generated_group=users
- ANSIBLE_EXTRA_VARS=generated_user=antoine generated_group=users enable_network=false
- ANSIBLE_PLAYBOOK=/packer/ansible/playbook-debian.yml
- ISO_CHECKSUM=file:https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS
#- ISO_CHECKSUM=file:https://cdimage.debian.org/mirror/cdimage/archive/10.7.0/amd64/iso-cd/SHA512SUMS
@@ -36,4 +36,4 @@ services:
- "./image/assets:/packer"
- "./image/cache:/packer-cache"
ports:
- "5900:5900"
- "5900:5900"

+ 1
- 0
image/assets/ansible/playbook-debian.yml View File

@@ -12,6 +12,7 @@
fail_msg: "Pass param ssh_pub, generated_user and generated_group to launch this playbook"
roles:
- role: debian-init
enable_network: false
- role: create-user
vars:
ssh_public_key: "{{ ssh_pub }}"


+ 7
- 1
image/assets/ansible/roles/debian-init/defaults/main.yml View File

@@ -1,4 +1,3 @@

grub_file: "/etc/default/grub"
grub_timeout: 1

@@ -11,3 +10,10 @@ initial_package:
- vim
- lsb-release
- cloud-init
- bash-completion

initial_service:
- serial-getty@ttyS0.service

# configure and enable network /etc/network/interface file
enable_network: true

+ 12
- 1
image/assets/ansible/roles/debian-init/tasks/main.yml View File

@@ -14,9 +14,10 @@
dest: "{{ network_config.dest }}"
owner: root
group: root
mode: '0644'
mode: "0644"
notify:
- Restart networking
when: enable_network

- name: "flush all notified handler"
meta: flush_handlers
@@ -28,3 +29,13 @@
update_cache: yes
state: present
notify: Start qemu-guest service

- name: "start/enable initial service"
become: yes
service:
name: "{{ service }}"
state: started
enabled: yes
loop: "{{ initial_service }}"
loop_control:
loop_var: service

Loading…
Cancel
Save