base_role/tasks/Lati.yml

45 lines
1.5 KiB
YAML
Raw Normal View History

2024-01-06 01:38:28 +00:00
# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- name: "base Lati.yml"
debug:
verbosity: 1
msg: "DEBUG: Including base Lati.yml env ansible_connection={{ ansible_connection|default('') }}"
- name: USB
shell: |
df /|sed -e 's/ .*//'|xargs blkid|sed -e 's/.*: LABEL="//' -e 's/".*//' -e 's/_.*//'
register: base_usb
- name: set_fact USB
set_fact:
BASE_USB: "{{base_usb.stdout}}"
- name: /etc/conf.d/dmcrypt
shell: |
sdb2=`df / | grep ^/ | sed -e 's/[0-9].*/2/'`
[ -f /etc/{{ETC_CONF_D}}/dmcrypt ] && \
[ -b $sdb2 ] && \
sed -e "s/source='LABEL=.*/source='LABEL={{BASE_USB}}_02SWAP'/" -i /etc/{{ETC_CONF_D}}/dmcrypt
[ -b $sdb2 ] && \
lb2=`swaplabel $sdb2|grep LABEL:|sed -e 's/.*: //'`
[ -n "$lb2" ] && \
[ "$lb2" = "{{BASE_USB}}_02SWAP" ] || \
swaplabel $sdb2 "{{BASE_USB}}_02SWAP"
exit 0
# FixMe: coaleasce with bootstrap cleanup
- name: pkg_resources
shell: |
# either way - make sure there is only one.
for elt in {{BASE_PYTHON2_MINOR}} {{BASE_PYTHON3_MINOR}} ; do
[ -d /usr/{{BASE_LIB}}/python$elt/site-packages/pkg_resources ] || continue
[ -d /usr/local/{{BASE_LIB}}/python$elt/site-packages/pkg_resources ] || continue
rm -rf /usr/local/{{BASE_LIB}}/python$elt/site-packages/pkg_resources.bad
mv /usr/local/{{BASE_LIB}}/python$elt/site-packages/pkg_resources/ \
/usr/local/{{BASE_LIB}}/python$elt/site-packages/pkg_resources.bad
done
exit 0