Skip to content

Commit df58265

Browse files
authoredJul 13, 2024··
Move to pipenv (#31)
move to pipenv/upgrade molecule + cleanups
1 parent 54a4bd2 commit df58265

36 files changed

+5681
-2212
lines changed
 

‎.ansible-lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ skip_list:
22
- command-instead-of-shell # Use shell only when shell functionality is required
33
- experimental # all rules tagged as experimental
44
- no-changed-when # Commands should not change things if nothing needs doing
5-
5+
- name[casing]

‎.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-python@v2
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
1212
with:
13-
python-version: '3.9'
13+
python-version: '3.10'
1414
- name: Install dependencies
1515
run: |
1616
python -m pip install --upgrade pip pipenv

‎Pipfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ verify_ssl = true
99
ansible = "*"
1010
ansible-lint = "*"
1111
flake8 = "*"
12-
molecule-docker = "*"
13-
yamllint = "==1.20.0"
12+
yamllint = "*"
13+
molecule = "*"
14+
molecule-plugins = {extras = ["docker"], version = "*"}
1415

1516
[requires]
16-
python_version = "3.9"
17+
python_version = "3.10"

‎Pipfile.lock

+667-541
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bootstrap.sh

+41-41
Original file line numberDiff line numberDiff line change
@@ -9,68 +9,68 @@ ANSIBLE_REPO="https://github.com/yuhonas/dotfiles.git"
99
export ANSIBLE_NOCOWS=1
1010

1111
if [ "$(uname)" == "Darwin" ]; then
12-
# Download and install Command Line Tools
13-
if [[ ! -x /usr/bin/gcc ]]; then
14-
echo "Info | Install | xcode"
15-
xcode-select --install
16-
fi
12+
# Download and install Command Line Tools
13+
if [[ ! -x /usr/bin/gcc ]]; then
14+
echo "Info | Install | xcode"
15+
xcode-select --install
16+
fi
1717

18-
# Download and install homebrew
19-
if [[ ! -x /opt/homebrew/bin/brew ]]; then
20-
echo "Info | Install | homebrew"
21-
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
22-
fi
23-
eval $(/opt/homebrew/bin/brew shellenv)
18+
# Download and install homebrew
19+
if [[ ! -x /opt/homebrew/bin/brew ]]; then
20+
echo "Info | Install | homebrew"
21+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
22+
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
23+
fi
24+
eval $(/opt/homebrew/bin/brew shellenv)
2425
else
25-
# Download and install linuxbrew
26-
if [[ ! -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
27-
# archlinux
28-
sudo pacman --sync --refresh --noconfirm --needed \
29-
base-devel \
30-
git ca-certificates \
31-
curl \
32-
git \
33-
libxcrypt-compat # for homebrew installation which installs ruby 2.6.8
26+
# Download and install linuxbrew
27+
if [[ ! -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
28+
# archlinux
29+
sudo pacman --sync --refresh --noconfirm --needed \
30+
base-devel \
31+
git ca-certificates \
32+
curl \
33+
git \
34+
libxcrypt-compat # for homebrew installation which installs ruby 2.6.8
3435

35-
# set locale
36-
sudo localedef -i en_US -f UTF-8 en_US.UTF-8
36+
# set locale
37+
sudo localedef -i en_US -f UTF-8 en_US.UTF-8
3738

38-
echo "Info | Install | linuxbrew"
39-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
40-
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>$HOME/.bash_profile
41-
fi
42-
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
39+
echo "Info | Install | linuxbrew"
40+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
41+
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>$HOME/.bash_profile
42+
fi
43+
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
4344
fi
4445

4546
brew update
4647

4748
# Download and install git
48-
if ! type git > /dev/null 2>&1; then
49-
echo "Info | Install | git"
50-
brew install git
49+
if ! type git >/dev/null 2>&1; then
50+
echo "Info | Install | git"
51+
brew install git
5152
fi
5253

5354
# Download and install Ansible
54-
if ! type ansible > /dev/null 2>&1; then
55-
echo "Info | Install | ansible"
56-
brew install ansible
55+
if ! type ansible >/dev/null 2>&1; then
56+
echo "Info | Install | ansible"
57+
brew install ansible
5758
fi
5859

5960
# Make the code directory
6061
mkdir -p $SRC_DIRECTORY
6162

6263
# Clone down ansible
6364
if [[ ! -d $ANSIBLE_DIRECTORY ]]; then
64-
git clone $ANSIBLE_REPO $ANSIBLE_DIRECTORY
65+
git clone $ANSIBLE_REPO $ANSIBLE_DIRECTORY
6566

66-
# if we're part of a build we should checkout the supplied SHA
67-
if [[ -n "$GITHUB_SHA" ]]; then
68-
git checkout "$GITHUB_SHA"
69-
fi
67+
# if we're part of a build we should checkout the supplied SHA
68+
if [[ -n "$GITHUB_SHA" ]]; then
69+
git checkout "$GITHUB_SHA"
70+
fi
7071
fi
7172

7273
if [[ -z "$NO_PROVISION" ]]; then
73-
# Provision the box
74-
ansible-playbook --ask-become-pass --become-method=sudo -i $ANSIBLE_DIRECTORY/inventory $ANSIBLE_DIRECTORY/playbook.yml
74+
# Provision the box
75+
ansible-playbook --ask-become-pass --become-method=sudo -i $ANSIBLE_DIRECTORY/inventory $ANSIBLE_DIRECTORY/playbook.yml
7576
fi
76-

‎molecule/default/Dockerfile.j2

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN set -xe \
3535
&& sed -i "/^%${SUDO_GROUP}/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers \
3636
&& sed -i "/%wheel/s/^# //g" /etc/sudoers
3737

38+
# set ansible user password to ansible
39+
RUN echo "${ANSIBLE_USER}:${ANSIBLE_USER}" | chpasswd
40+
3841
USER ${ANSIBLE_USER}:${ANSIBLE_USER}
3942
WORKDIR /home/${ANSIBLE_USER}
4043

‎molecule/default/converge.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
- name: Fail if molecule group is missing
2+
hosts: localhost
3+
tasks:
4+
- name: Print some info
5+
ansible.builtin.debug:
6+
msg: "{{ groups }}"
7+
8+
- name: Assert group existence
9+
ansible.builtin.assert:
10+
that: "'molecule' in groups"
11+
fail_msg: |
12+
molecule group was not found inside inventory groups: {{ groups }}
13+
14+
- name: Converge
15+
hosts: molecule
16+
# We disable gather facts because it would fail due to our container not
17+
# having python installed. This will not prevent use from running 'raw'
18+
# commands. Most molecule users are expected to use containers that already
19+
# have python installed in order to avoid notable delays installing it.
20+
gather_facts: false
21+
tasks:
22+
- name: Check uname
23+
ansible.builtin.raw: uname -a
24+
register: result
25+
changed_when: false
26+
27+
- name: Print some info
28+
ansible.builtin.assert:
29+
that: result.stdout | regex_search("^Linux")

‎molecule/default/molecule.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
---
22
driver:
3-
name: "docker"
4-
lint: |
5-
set -e
6-
# yamllint .
7-
ansible-lint -x formatting playbook.yml roles/
8-
flake8
3+
name: docker
4+
dependency:
5+
name: galaxy
6+
options:
7+
requirements-file: requirements.yml
8+
# lint: |
9+
# set -e
10+
# # yamllint .
11+
# ansible-lint -x formatting playbook.yml roles/
12+
# flake8
913
platforms:
10-
- name: "molecule_instance"
14+
- name: molecule_instance
1115
image: "archlinux/archlinux:latest"
16+
platform: amd64
17+
pre_build_image: false
1218
env:
1319
PATH: "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
1420
ANSIBLE_USER: "linuxbrew"
1521
SUDO_GROUP: "wheel"
1622
DEPLOY_GROUP: "deployer"
23+
scenario:
24+
name: default
1725
provisioner:
1826
name: "ansible"
1927
env:

‎molecule/default/requirements.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
collections:
2+
- name: community.docker
3+
version: ">=3.10.2"

‎roles/developer/tasks/main.yml

-15
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- borgbackup # for secure incremental backups
1010
- coreutils
1111
- ctags # index generation for source and header files
12-
- emacs
1312
- jdupes # faster then fdupes
1413
- fx # for exploring json files in the terminal
1514
- grex # A tool generating regular expressions from user-provided test cases
@@ -37,20 +36,6 @@
3736
- uv # pip replacement https://github.com/astral-sh/uv
3837
- w3m # text based browser
3938

40-
# - name: find where asdf was installed
41-
# command: "brew --prefix asdf"
42-
# register: asdf_location
43-
# changed_when: false
44-
45-
# - debug: msg="{{ asdf_location.stdout }}"
46-
47-
#- name: ensure asdf is in the $PATH
48-
# blockinfile:
49-
# path: "{{ ansible_env.HOME }}/.bashrc"
50-
# block: |
51-
# export ASDF_DIR={{ asdf_location.stdout }}
52-
# export PATH=~/.asdf/shims:$PATH
53-
5439
- name: add asdf plugins
5540
command: "asdf plugin-add {{ item }}"
5641
with_items:

‎roles/dotfiles/files/Mackup/.bundle/config

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ BUNDLE_GEM__TEST: "rspec"
33
BUNDLE_GEM__MIT: "false"
44
BUNDLE_GEM__COC: "true"
55
BUNDLE_BUILD__MYSQL2: "--with-opt-dir=/usr/local/opt/openssl"
6+
BUNDLE_GEM__CI: "github"
7+
BUNDLE_GEM__CHANGELOG: "false"
8+
BUNDLE_GEM__LINTER: "rubocop"

0 commit comments

Comments
 (0)
Please sign in to comment.