From 4a144817913f40dfd5f98b5f9f0f4e56c725e9e9 Mon Sep 17 00:00:00 2001 From: Colin Hutchinson Date: Fri, 15 Dec 2023 08:49:32 -0500 Subject: [PATCH] fix: various changes found while bootstrapping a new machine (#306) --- Makefile | 21 ++++++++++++++++----- README.md | 3 ++- group_vars/all.yml | 2 ++ install-docker.yml | 2 +- playbook.yml | 16 ++++++++-------- requirements.txt | 12 ++++++++++++ 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 60c6eba..d8e8a2b 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,23 @@ -.PHONY: setup +.PHONY: setup clean development_environment + +# Name of the virtual environment directory +VENV := venv + +# Python executable inside the virtual environment +PYTHON := $(VENV)/bin/python +PIP := $(VENV)/bin/pip development_environment: setup ansible-playbook -i "localhost," playbook.yml --ask-become-pass -setup: - pip install -r requirements.txt - pip freeze --user > requirements.txt +setup: $(VENV)/bin/activate + $(PIP) install -r requirements.txt + $(PIP) freeze > requirements.txt test -d galaxy || ansible-galaxy install -p galaxy -f -r requirements.yml +$(VENV)/bin/activate: + test -d $(VENV) || python3 -m venv $(VENV) + $(PYTHON) -m pip install --upgrade pip + clean: - rm -rf galaxy + rm -rf galaxy $(VENV) diff --git a/README.md b/README.md index dea18cd..3f256b9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Ansible playbooks that control my various computers ``` sudo apt update -sudo apt install python3-pip +sudo apt install python3-pip python3.11-venv export PATH=$HOME/.local/bin:$PATH USER=ubuntu make development_environment @@ -62,6 +62,7 @@ git config --global user.signingkey chutchic@gmail.com git config --global commit.gpgsign true git config --global user.name "Colin Hutchinson" git config --global push.default current +git config --global init.defaultBranch main ``` # Setup ssh private key diff --git a/group_vars/all.yml b/group_vars/all.yml index a77dc80..6d95086 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -28,3 +28,5 @@ apt_things_to_install: - gnome-screenshot - monkeysphere - openssh-server +- net-tools +- wireless-tools diff --git a/install-docker.yml b/install-docker.yml index de8075d..897865a 100644 --- a/install-docker.yml +++ b/install-docker.yml @@ -21,6 +21,6 @@ - name: Add user to docker group become: yes user: - name: "{{ lookup('env' 'USER') }}" + name: "hutchic" groups: docker append: yes diff --git a/playbook.yml b/playbook.yml index 6fa1558..21bf7f8 100644 --- a/playbook.yml +++ b/playbook.yml @@ -9,14 +9,14 @@ git_install_from_source_dependencies: - gcc pre_tasks: - - name: import ssh authorized key - ansible.posix.authorized_key: - user: "ubuntu" - state: present - key: "{{ lookup('url', 'https://hutchic.keybase.pub/id_rsa.pub', split_lines=False) }}" - - - name: Install 1password - include: install-1password.yml + # - name: import ssh authorized key + # ansible.posix.authorized_key: + # user: "hutchic" + # state: present + # key: "{{ lookup('url', 'https://keybase.io/hutchic/pgp_keys.asc?fingerprint=2456905d58033cb18166454aef080fc8d67f84bc', split_lines=False) }}" + + # - name: Install 1password + # include: install-1password.yml - name: Upgrade via apt become: yes diff --git a/requirements.txt b/requirements.txt index 26c79c8..9143719 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,9 +7,12 @@ black==23.3.0 boxsdk==3.7.1 bracex==2.3.post1 certifi==2023.7.22 +cffi==1.16.0 cfgv==3.3.1 charset-normalizer==3.1.0 +click==8.1.7 commonmark==0.9.1 +cryptography==41.0.7 detect-secrets @ git+https://github.com/ibm/detect-secrets.git@0ccc25a57be21eb401e0bd37e5c053c20a818208 distlib==0.3.6 enrich==1.2.7 @@ -20,7 +23,9 @@ idna==3.4 iniconfig==2.0.0 Jinja2==3.1.2 jsonschema==4.20.0 +jsonschema-specifications==2023.11.2 markdown-it-py==2.2.0 +MarkupSafe==2.1.3 mdurl==0.1.2 mypy-extensions==1.0.0 nodeenv==1.7.0 @@ -30,21 +35,28 @@ platformdirs==3.10.0 pluggy==1.0.0 pre-commit==3.2.2 py==1.11.0 +pycparser==2.21 Pygments==2.16.1 +PyJWT==2.8.0 pyrsistent==0.19.3 pytest==7.3.1 python-dateutil==2.8.2 +PyYAML==6.0.1 +referencing==0.32.0 requests==2.31.0 requests-toolbelt==0.10.1 resolvelib==0.5.4 rich==13.3.4 +rpds-py==0.13.2 ruamel.yaml==0.17.21 ruamel.yaml.clib==0.2.7 +six==1.16.0 subprocess-tee==0.4.1 tabulate==0.9.0 tenacity==8.2.2 toml==0.10.2 tomli==2.0.1 +urllib3==2.1.0 virtualenv==20.21.0 wcmatch==8.4.1 wrapt==1.15.0