Last active
March 27, 2020 00:14
-
-
Save anthonyinfinity/8bf9b4906d9851e5cbe88fdce4d7c60d to your computer and use it in GitHub Desktop.
New ansible role. Add it to /usr/local/bin/newarproj and sh newarproj.sh pythonversion projectname to init a role dir.
This file contains hidden or 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
#!/bin/sh | |
eval "$(pyenv init -)" | |
eval "$(pyenv virtualenv-init -)" | |
# Usage: $ sh newarproj.sh pythonversion projectname | |
molecule init role -r $2 && \ | |
cd $2 && CURDIR=$(PWD)\ | |
pyenv local $1 && \ | |
pyenv virtualenv venv-$2 && \ | |
pyenv local venv-$2 && \ | |
pyenv activate venv-$2 | |
cd ${CURDIR} && \ | |
pip install git+https://github.com/ansible/ansible.git@devel | |
cd ${CURDIR} && \ | |
pip install -r https://gist.githubusercontent.com/anthonyinfinity/c2f9681209a70de0a188718ebcdc9c67/raw/6011f19a6088279ceb6d3e823321f9dfe14c0039/base-role-requirements.txt && \ | |
pip freeze -l > requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment