Automate deploy to AWS with preinstalled ansible, awscli, awsebcli, etc...
2.9K
- EB CLI 3.15.3 (Python 2.7.1)
- aws-cli/1.16.234 Python/2.7.12 Linux/4.9.184-linuxkit botocore/1.12.224
- ansible 2.8.4
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
- python version = 2.7.12
- pip 19.2.3 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
- Python 2.7.12
- Python 3.5.2
- nodejs 10.16.3
- npm 6.9.0
- etc
deliver:
stage: prod
image: ruanzx/aws:[tag]
before_script:
- eval $(ssh-agent -s)
- ssh-keyscan [host] >> ~/.ssh/known_hosts
- echo "$AWS_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$GIT_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- |
echo "[default]
aws_access_key_id = $AWS_ACCESS_KEY_ID
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials
- export ANSIBLE_INVENTORY=$PWD/ec2.py
- export ANSIBLE_CONFIG=$PWD/ansible.cfg
- export ANSIBLE_HOST_KEY_CHECKING=False
- export EC2_INI_PATH=$PWD/ec2.ini
- python $PWD/ec2.py --list
script:
- ansible -i ec2.py -u ubuntu all -m ping
- ansible-playbook -i ec2.py -u ubuntu --limit "tag_Name_$AWS_INSTANCE_ENV" playbook.yml --extra-vars "env=test" -e 'ansible_python_interpreter=/usr/bin/python3' --verbose
when: manual
only:
- tags
tags:
- deploy
Content type
Image
Digest
Size
339.4 MB
Last updated
about 7 years ago
docker pull ruanzx/aws