=> {"changed": false, "msg": "Error connecting: Error while fetching server API version: HTTPConnectionPool(host='localhost', port=2375): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffbcc43eb90>: Failed to establish a new connection: [Errno 111] Connection refused',))"}
Это при попытке банальной авторизации в Docker Hub:
- name: Releasing image
hosts: localhost
gather_facts: no
tasks:
- name: Authorize
docker_login:
username: "{{ docker_hub_user }}"
password: "{{ docker_hub_password }}"
reauthorize: yes
...
Аналогичный сценарий из того же репозитория работает ок:
- name: Publishing image
hosts: localhost
gather_facts: no
tasks:
- name: Authorize
docker_login:
username: "{{ docker_hub_user }}"
password: "{{ docker_hub_password }}"
reauthorize: yes
...
Первый плейбук запускается Make'ом:
docker-release:
@echo "Publish release… (supported attributes: ENV, VER)"
ansible-playbook ansible/releasing.yml -i ansible/$(ENV) -e "release_version=$(VER)" --vault-password-file ansible/vault.txt
второй:
docker-publish:
@echo "Publish app image in Docker Hub… (supported attributes: ENV, VER)"
ansible-playbook ansible/publishing.yml -i ansible/$(ENV) -e "release_version=$(VER)" --vault-password-file ansible/vault.txt
Разница только в том, что первый (не работающий) тригерится в Bitbucket pipelines таким правилом:
tags:
v*:
- step:
name: Configs generation
script:
- make cfg-gen ENV=staging
artifacts:
- .env
- step:
name: Make release
script:
- pip install docker
- export ANSIBLE_CONFIG="./ansible/ansible.cfg"
- RELEASE_VER=${BITBUCKET_TAG//[^[:digit:].]/};
- make docker-release ENV=staging VER=$RELEASE_VER
второй таким:
release/*:
- step:
name: Configs generation
script:
- make cfg-gen ENV=test
artifacts:
- .env
- migrations-config.json
- step:
name: Linting code
image: node:9.2
caches:
- node
script:
- npm i
- npm run lint
- step:
name: Building app image
trigger: manual
services:
- docker
caches:
- docker
- pip
script:
- pip install docker
- export ANSIBLE_CONFIG="./ansible/ansible.cfg"
- BRANCH_VER=${BITBUCKET_BRANCH//[^[:digit:].]/};
- RELEASE_VER=$BRANCH_VER'-rc'
- make docker-build ENV=test VER=$RELEASE_VER
- make docker-save ENV=test VER=$RELEASE_VER
artifacts:
- willingandable.ca.tar
- parallel:
- step:
name: Pushing image to registry
services:
- docker
script:
- pip install docker
- export ANSIBLE_CONFIG="./ansible/ansible.cfg"
- BRANCH_VER=${BITBUCKET_BRANCH//[^[:digit:].]/};
- RELEASE_VER=$BRANCH_VER'-rc'
- make docker-load ENV=test VER=$RELEASE_VER
- make docker-publish ENV=test VER=$RELEASE_VER
- step:
name: Provisioning environment
script:
- yum -y install rsync
- mkdir env
- cp .env ./env/.env
- export ANSIBLE_CONFIG="./ansible/ansible.cfg"
- make env-provision ENV=test
Может отступы теряются?
А почему в первом пайплайне нет services docker?
Обсуждают сегодня