Adding jail precreation chroot tools
This commit is contained in:
parent
5091481b42
commit
09e19a53a8
6 changed files with 46 additions and 1 deletions
11
tasks/chroot/preinstall_reset.yml
Normal file
11
tasks/chroot/preinstall_reset.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
- name: Unmounting devFS from chroot
|
||||
mount:
|
||||
path: '{{ vars["jail_" + jail_name + "_new_path"] }}/dev'
|
||||
state: unmounted
|
||||
|
||||
- name: Create resolv.conf for live usage in jail
|
||||
copy:
|
||||
dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc/resolv.conf'
|
||||
content: |
|
||||
nameserver {{ vars["jail_" + jail_name + "_new_ip4"] }}
|
||||
|
28
tasks/chroot/preinstall_set.yml
Normal file
28
tasks/chroot/preinstall_set.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
- name: Create local repo config dir
|
||||
file:
|
||||
path: '{{ vars["jail_" + jail_name + "_new_path"] }}/usr/local/etc/pkg/repos'
|
||||
state: directory
|
||||
|
||||
- name: Copy FreeBSD repo config in place
|
||||
copy:
|
||||
src: FreeBSD.conf
|
||||
dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/usr/local/etc/pkg/repos/FreeBSD.conf'
|
||||
|
||||
- name: Create resolv.conf for install usage in jail
|
||||
copy:
|
||||
dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc/resolv.conf'
|
||||
content: |
|
||||
nameserver 127.0.0.1
|
||||
|
||||
- name: Mounting devFS into chroot for pkg
|
||||
mount:
|
||||
src: devfs
|
||||
path: '{{ vars["jail_" + jail_name + "_new_path"] }}/dev'
|
||||
fstype: devfs
|
||||
state: mounted
|
||||
|
||||
- name: Restarting syslog
|
||||
service:
|
||||
name: syslogd
|
||||
state: restarted
|
||||
|
|
@ -104,3 +104,4 @@
|
|||
ip6_addr = {{ jail_THIS_with_ip6 }}
|
||||
when: 'jail_THIS_with_ip6 != False'
|
||||
|
||||
# vim: sw=2
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
loop_control:
|
||||
loop_var: jail_id
|
||||
|
||||
- name: Reload PF
|
||||
command: /sbin/pfctl -f /etc/pf.conf
|
||||
|
||||
- name: Starting jail when IPv6 present
|
||||
command:
|
||||
jail -c
|
||||
|
@ -102,4 +105,4 @@
|
|||
loop_control:
|
||||
loop_var: jail_id
|
||||
|
||||
|
||||
# vim: sw=2
|
||||
|
|
|
@ -71,3 +71,4 @@
|
|||
{{ dynamic_jails_path }}/{{ jail_id }}
|
||||
state: absent
|
||||
|
||||
# vim: sw=2
|
||||
|
|
|
@ -51,3 +51,4 @@
|
|||
name: syslogd
|
||||
state: restarted
|
||||
|
||||
# vim: sw=2
|
||||
|
|
Loading…
Reference in a new issue