Use new commands
This commit is contained in:
parent
a0996607a4
commit
5cec9fc098
|
@ -7,14 +7,14 @@
|
|||
ignore_errors: true
|
||||
|
||||
- name: Refresh pkg mirror when package install failed
|
||||
command: |
|
||||
ansible.builtin.command: |
|
||||
'{{ ansible_roles_path }}/karolyi.ansible-freebsd-jailhost-tools/tools/pkgmirror-jailrevalidator.py'
|
||||
'{{ pkgmirror_url }}' '{{ vars["jail_" + jail_name + "_new_path"] }}' '{{ install_packages }}'
|
||||
register: revalidate_command
|
||||
when: install_result.failed
|
||||
|
||||
- name: Cleaning downloaded package cache in jail
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/pkg
|
||||
-c {{ vars["jail_" + jail_name + "_new_path"] }}
|
||||
clean -ayq
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
- name: Cleaning pkg cache
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/pkg
|
||||
-c {{ vars["jail_" + jail_name + "_new_path"] }}
|
||||
clean -ayq
|
||||
|
||||
- name: Unmounting directories
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/sbin/umount
|
||||
-a -F
|
||||
{{ dynamic_jails_path }}/configs/{{ vars["jail_" + jail_name + "_newest_id"] }}/fstab
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
state: mounted
|
||||
|
||||
- name: Mounting directories
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/sbin/mount
|
||||
-a -F
|
||||
{{ dynamic_jails_path }}/configs/{{ vars["jail_" + jail_name + "_newest_id"] }}/fstab
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
when: local_resolv is failed
|
||||
|
||||
- name: Setup timezone in jail
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/tzsetup
|
||||
-C {{ vars['jail_' + jail_name + '_new_path'] }}
|
||||
{{ vars['jail_' + jail_name + '_timezone'|default(vars['default_timezone'])] }}
|
||||
|
|
|
@ -84,10 +84,10 @@
|
|||
loop_var: jail_id
|
||||
|
||||
- name: Reload PF
|
||||
command: /sbin/pfctl -f /etc/pf.conf
|
||||
ansible.builtin.command: /sbin/pfctl -f /etc/pf.conf
|
||||
|
||||
- name: Starting jail when IPv6 present
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
jail -c
|
||||
{{
|
||||
vars['jail_' + jail_name + '_newest_id']
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
when: 'jail_THIS_with_ip6 != False'
|
||||
|
||||
- name: Starting jail when no IPv6 present
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
jail -c
|
||||
{{
|
||||
vars['jail_' + jail_name + '_newest_id']
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ jail_id in running_jail_ids }}
|
||||
|
||||
- name: Terminating jail when running
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/jail -r {{ jail_id }}
|
||||
when: jail_is_old_running
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
marker: '# {mark} ANSIBLE MANAGED BLOCK: {{ jail_id }}'
|
||||
|
||||
- name: Getting mounts under this jail
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
/sbin/mount -p
|
||||
| grep '{{ dynamic_jails_path }}/{{ jail_id }}'
|
||||
| awk '{print $2}'
|
||||
|
@ -31,7 +31,7 @@
|
|||
_root_mount_point: '{{ dynamic_jails_path + "/" + jail_id }}'
|
||||
|
||||
- name: Unmounting all mounts from under the jail so it could be destroyed
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/sbin/umount
|
||||
'{{ mountpoint }}'
|
||||
when: mountpoint != _root_mount_point
|
||||
|
@ -67,7 +67,7 @@
|
|||
# Due to a possible bug in the ZFS/FreeBSD kernel, destroying the dataset
|
||||
# sometimes isn't possible after freeing it up. Hence we use '-f'
|
||||
- name: Force-destroying ZFS dataset {{ dynamic_jails_dataset_name }}/{{ jail_id }}
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/sbin/zfs destroy -f
|
||||
{{ dynamic_jails_dataset_name }}/{{ jail_id }}
|
||||
# when: 'zfs_destroy is failed and ": Device busy" in zfs_destroy.msg'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
- block:
|
||||
|
||||
- name: Check if packages have to be upgraded
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/pkg
|
||||
-j {{ vars['jail_' + jail_name + '_newest_id'] }}
|
||||
upgrade --dry-run
|
||||
|
@ -38,7 +38,7 @@
|
|||
jail_{{ jail_name }}_pkgs: '{{ jail_pkgs }}'
|
||||
|
||||
- name: Upgrade packages when necessary
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/sbin/pkg
|
||||
-j {{ vars['jail_' + jail_name + '_newest_id'] }}
|
||||
upgrade
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
when: 'jail_THIS_with_ip6 != False'
|
||||
|
||||
- name: Sending HUP to any any crucial processes to reload their configuration
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
/usr/bin/killall -HUP dnsmasq
|
||||
failed_when: false
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3.7
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from collections import defaultdict
|
||||
|
|
Loading…
Reference in New Issue