-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm | ||
|
||
# enable git bash completion | ||
RUN ln -s /usr/share/bash-completion/completions/git /usr/share/bash-completion/bash_completion | ||
|
||
# install sshpass for ansible SSH password auth and vim just in case | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y sshpass vim | ||
RUN apt-get clean | ||
|
||
# install ansible and ansible-lint | ||
RUN python3 -m pip install ansible-core~=2.16.6 ansible-lint~=24.2.3 | ||
|
||
# create /workspace directory | ||
WORKDIR /workspace | ||
RUN chown -R vscode:vscode /workspace | ||
|
||
# run commands as non-root user | ||
USER vscode | ||
|
||
# make prompt multiline cause it's too long by default | ||
RUN sed -i -E -e '/PS1="\$/c\ PS1="${userpart} ${lightblue}\\w ${gitbranch}${removecolor}\\n\\$ "' ~/.bashrc | ||
|
||
# install collection requirements | ||
COPY collections/requirements.yaml . | ||
RUN ansible-galaxy collection install -r requirements.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "ansible-rke2", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "../../Ansible/Playbooks/RKE2" | ||
}, | ||
"mounts": ["source=${env:HOME}/.ssh,target=/home/vscode/.ssh,type=bind"], | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"bierner.markdown-preview-github-styles", | ||
"DavidAnson.vscode-markdownlint", | ||
"dhoeric.ansible-vault", | ||
"eamodio.gitlens", | ||
"esbenp.prettier-vscode", | ||
"mhutchie.git-graph", | ||
"ms-python.black-formatter", | ||
"ms-python.flake8", | ||
"ms-python.isort", | ||
"oderwat.indent-rainbow", | ||
"redhat.ansible", | ||
"samuelcolvin.jinjahtml", | ||
"tamasfe.even-better-toml", | ||
"yzhang.markdown-all-in-one" | ||
], | ||
"settings": { | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[markdown]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[python]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit" | ||
} | ||
}, | ||
"ansible.python.interpreterPath": "/usr/local/bin/python", | ||
"ansibleVault.executable": "/home/vscode/venv/bin/ansible-vault", | ||
"editor.formatOnSave": true, | ||
"files.associations": { | ||
"*.yaml": "ansible" | ||
}, | ||
"files.trimFinalNewlines": true, | ||
"files.trimTrailingWhitespace": true, | ||
"python.defaultInterpreterPath": "/usr/local/bin/python" | ||
} | ||
} | ||
} | ||
} |