-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial FreeBSD jail support completed
- Loading branch information
Showing
5 changed files
with
123 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
- name: update host | ||
include_tasks: FreeBSD/update_host.yml | ||
- name: set _update_freebsd_host | ||
set_fact: | ||
_update_freebsd_host: '{{ package_update.freebsd.host | default(true) }}' | ||
|
||
- name: set _get_running_jails | ||
set_fact: | ||
_get_running_jails: '{{ package_update.freebsd.get_running_fails | default(true) }}' | ||
|
||
- name: get the running jails | ||
include_tasks: FreeBSD/get_running_jails.yml | ||
when: | ||
- _get_running_jails | ||
|
||
- name: set _update_freebsd_jails | ||
set_fact: | ||
_update_freebsd_jails: '{{ package_update.freebsd.jails | default( freebsd_running_jails) }}' | ||
|
||
- name: add id 0 to the list to update the host system | ||
set_fact: | ||
_update_freebsd_jails: '{{ [ 0 ] + _update_freebsd_jails }}' | ||
when: | ||
- _update_freebsd_host | ||
|
||
- name: update jails | ||
include_tasks: FreeBSD/update.yml | ||
loop: "{{ _update_freebsd_jails | default(omit) }}" | ||
loop_control: | ||
loop_var: jail_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- name: execute jls | ||
shell: jls | sed 1d | awk '{ print $3 }' | ||
register: cmd_jail_id_list | ||
changed_when: False | ||
- name: set freebsd_running_jails | ||
set_fact: | ||
freebsd_running_jails: '{{ cmd_jail_id_list.stdout_lines }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
- name: set my_pkg_cmd var for host | ||
set_fact: | ||
my_pkg_cmd: pkg | ||
when: | ||
- jail_id == 0 | ||
- name: set my_pkg_cmd for jail | ||
set_fact: | ||
my_pkg_cmd: 'pkg -j {{ jail_id }}' | ||
when: | ||
- jail_id != 0 | ||
- name: 'pkg update {{ jail_id }}' | ||
command: '{{ my_pkg_cmd }} update' | ||
register: pkg_update_y | ||
changed_when: "pkg_update_y.rc != 0" | ||
- name: 'verify if there are upgrades available {{ jail_id }}' | ||
command: '{{ my_pkg_cmd }} upgrade -n' | ||
register: pkg_upgrade_n | ||
changed_when: "pkg_upgrade_n.rc != 0" | ||
failed_when: "pkg_upgrade_n.rc > 1" | ||
- name: 'upgrade {{ jail_id }}' | ||
command: '{{ my_pkg_cmd }} upgrade -y' | ||
when: "pkg_upgrade_n.rc != 0" |
This file was deleted.
Oops, something went wrong.