hosts.yml

This commit is contained in:
2023-12-30 12:01:03 +00:00
parent cb32e7e66d
commit ac375a87c7
11 changed files with 1558 additions and 28 deletions

View File

@@ -2,16 +2,23 @@
---
- name: "DEBUG: ansible-gentoo_install nbd_disk ansible_connection"
debug:
verbosity: 1
msg: "DEBUG: ansible-gentoo_install nbd_disk={{ nbd_disk }} ansible_connection={{ ansible_connection }}"
verbosity: 0
msg: "DEBUG: ansible-gentoo_install nbd_disk={{ nbd_disk }} AGI_NBD_DISK={{AGI_NBD_DISK}} ansible_connection={{ ansible_connection }}"
check_mode: false
- set_fact:
AGI_target: Gentoo2
- name: "ansible-gentoo_install"
set_fact:
ansible_check_mode: false
when:
- "'ansible-gentoo_install' in ROLES"
- ansible_check_mode is true
- name: look for nbd partitions
shell: |
grep nbd /proc/partitions | head -1
grep nbd /proc/partitions | head -1|sed -e 's/.* //'
register: nbd_out
failed_when: false
check_mode: false
@@ -28,45 +35,52 @@
shell: |
echo nbd_disk={{ nbd_disk }} ansible_connection={{ ansible_connection }}
echo ansible_distribution={{ansible_distribution}} BOX_GENTOO_FROM_MP={{BOX_GENTOO_FROM_MP}}
[ -d '/mnt/o/var/local/src/play_tox/src/ansible_gentooimgr' ] || exit 1
[ -f '/mnt/o/var/local/src/play_tox/src/ansible_gentooimgr/__init__.py' ] || exit 2
[ -d '/mnt/o/var/local/src/play_tox/src/ansible_gentooimgr/gentooimgr' ] || exit 3
[ -f '/mnt/o/var/local/src/play_tox/src/ansible_gentooimgr/gentooimgr/__init__.py' ] || exit 4
[ -d '{{PLAY_ANSIBLE_SRC}}/src/ansible_gentooimgr' ] || exit 1
[ -f '{{PLAY_ANSIBLE_SRC}}/src/ansible_gentooimgr/__init__.py' ] || exit 2
[ -d '{{PLAY_ANSIBLE_SRC}}/src/ansible_gentooimgr/gentooimgr' ] || exit 3
[ -f '{{PLAY_ANSIBLE_SRC}}/src/ansible_gentooimgr/gentooimgr/__init__.py' ] || exit 4
{{ansible_python_interpreter}} \
-c "import sys; sys.path.append('/mnt/o/var/local/src/play_tox/src/ansible_gentooimgr'); import gentooimgr; print(gentooimgr.__file__)"
-c "import os sys; sys.path.append('{{PLAY_ANSIBLE_SRC}}/src/ansible_gentooimgr'); import gentooimgr; print(os.path.dirname(gentooimgr.__file__))"
register: gentooimgr_out
check_mode: false
ignore_errors: true
- block:
- set_fact:
- name: set AGI_gentooimgr_configs
set_fact:
AGI_gentooimgr_configs: "{{gentooimgr_out.stdout}}/configs"
- name: ansible_gentooimgr nbd status
ansible_gentooimgr:
action: status
loglevel: 10
loglevel: "{{BOX_NBD_LOGLEVEL}}"
threads: 1
config: cloud.config
profile: openrc
kernel_dir: /usr/src/linux
portage: '{{AGI_NBD_FILES}}/portage-20231223.tar.xz'
stage3: '{{AGI_NBD_FILES}}/stage3-amd64-openrc-20231217T170203Z.tar.xz'
temporary_dir: "{{AGI_NBD_FILES}}"
config: base.config
profile: "{{BOX_NBD_BASE_PROFILE}}"
kernel_dir: "{{BOX_NBD_KERNEL_DIR}}"
portage: '{{BOX_NBD_PORTAGE_FILE}}'
stage3: '{{BOX_NBD_STAGE3_FILE }}'
temporary_dir: "{{BOX_NBD_BASE_DIR}}"
download_dir: "{{AGI_NBD_FILES}}"
register: ansible_gentooimgr_out
ignore_errors: true
check_mode: false
- name: "DEBUG: ansible-gentoo_install nbd_disk ansible_connection"
debug:
verbosity: 0
var: ansible_gentooimgr_out
check_mode: false
when:
- ansible_connection in ['chroot', 'local', 'libvirt_qemu']
- ansible_distribution == 'Gentoo' or BOX_GENTOO_FROM_MP != ''
- ansible_distribution == 'Gentoo' or BOX_GENTOO_FROM_MP not in ['/', '']
# - nbd_disk|default('') == AGI_NBD_DISK
- include_tasks: local.yml
- name: include_tasks local.yml
include_tasks: local.yml
when:
- ansible_connection in ['chroot', 'local']
- ansible_distribution == 'Gentoo' or BOX_GENTOO_FROM_MP != ''
- nbd_disk|default('') == AGI_NBD_DISK
- ansible_distribution == 'Gentoo' or BOX_GENTOO_FROM_MP not in ['/', '']
# - nbd_disk|default('') == AGI_NBD_DISK