base_role/tasks/Lati.yml

45 lines
1.5 KiB
YAML
Executable File

# -*- 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