Drop venv completely, use host ansible
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1 @@
|
||||
/venv/
|
||||
/*.bundle
|
||||
|
||||
40
Makefile
40
Makefile
@@ -1,26 +1,15 @@
|
||||
DISTRO := $(shell . /etc/os-release && echo $$NAME)
|
||||
|
||||
venv = ./venv
|
||||
requirements = requirements.txt
|
||||
activate = . $(venv)/bin/activate
|
||||
pip = pip
|
||||
|
||||
ifeq ($(DISTRO),Ubuntu)
|
||||
ansible_run = $(activate) && ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
|
||||
else
|
||||
ansible_run =ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
|
||||
endif
|
||||
ansible_run = ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 --inventory localhost, --diff ./playbook.yml ${ANSIBLE_EXTRA_ARGS}
|
||||
|
||||
.PHONY: all
|
||||
all: | venv
|
||||
all:
|
||||
$(ansible_run)
|
||||
|
||||
.PHONY: config
|
||||
config: | venv
|
||||
config:
|
||||
$(ansible_run) --skip-tags system-update
|
||||
|
||||
.PHONY: system-update
|
||||
system-update: venv
|
||||
system-update:
|
||||
$(ansible_run) --tags system-update
|
||||
|
||||
.PHONY: reboot
|
||||
@@ -35,30 +24,13 @@ poweroff:
|
||||
weekend: | update poweroff
|
||||
|
||||
.PHONY: packages
|
||||
packages: venv
|
||||
packages:
|
||||
$(ansible_run) --tags packages
|
||||
|
||||
.PHONY: dotfiles
|
||||
dotfiles: venv
|
||||
dotfiles:
|
||||
$(ansible_run) --tags dotfiles
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf venv
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
./test-in-docker.sh
|
||||
|
||||
ifeq ($(DISTRO), Ubuntux)
|
||||
venv:
|
||||
python3 -m venv $(venv)
|
||||
$(activate) && $(pip) install -r $(requirements)
|
||||
else
|
||||
venv:
|
||||
true
|
||||
endif
|
||||
|
||||
.PHONY: freeze
|
||||
freeze:
|
||||
$(activate) && $(pip) freeze > $(requirements)
|
||||
|
||||
10
install.sh
10
install.sh
@@ -77,19 +77,13 @@ if ! command -v make >/dev/null ; then
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
# Required for compiling modules in venv.
|
||||
if ! command -v gcc >/dev/null ; then
|
||||
printf 'gcc not installed, installing ...\n'
|
||||
_install "gcc"
|
||||
printf 'Done\n'
|
||||
fi
|
||||
|
||||
if [[ $NAME == "Arch Linux" ]] ; then
|
||||
_install "ansible"
|
||||
fi
|
||||
|
||||
if [[ $NAME == "Ubuntu" ]] ; then
|
||||
_install "python3-venv"
|
||||
_install "ansible"
|
||||
_install "python3-jmespath"
|
||||
fi
|
||||
|
||||
cd "$DOTDIR" && make
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
ansible==4.6.0
|
||||
ansible-core==2.11.5
|
||||
cffi==1.14.6
|
||||
cryptography==35.0.0
|
||||
Jinja2==3.0.1
|
||||
jmespath==0.10.0
|
||||
MarkupSafe==2.0.1
|
||||
packaging==21.0
|
||||
pycparser==2.20
|
||||
pyparsing==2.4.7
|
||||
PyYAML==5.4.1
|
||||
resolvelib==0.5.4
|
||||
Reference in New Issue
Block a user