philm / ansible_playbook Goto Github PK
View Code? Open in Web Editor NEWDocker Image for running Ansible Playbook commands
Docker Image for running Ansible Playbook commands
i got this output after running this command
docker run -it --rm --name temporary-anisble-executer -v "$PWD":/var/lib/jenkins/ansible -w /usr/src/app philm/ansible_playbook /var/lib/jenkins/ansible/playbook.yml --user=jenkins --extra-vars ImageName=majdmn/node-back --extra-vars imageTag=9ed05ec --extra-vars Namespace=test
I sorted out most problems now but this is blocking:
docker-compose up -d
Creating ansible_target
Creating drugimport_playbooks_1
Creating ansible_player
docker-compose run player download_files_from_ftp.yml -i inventory
PLAY ***************************************************************************
TASK [setup] *******************************************************************
fatal: [ansible_target]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}
PLAY RECAP *********************************************************************
ansible_target : ok=0 changed=0 unreachable=1 failed=0
make: *** [import] Error 3
Update: trying this ansible/ansible#13401
im trying to use this for the first time. with a simple playbook. im not getting a sensible output and I would be very grateful for any advice you can offer.
here is my playbook.yml
---
- hosts: ansible_target
tasks:
- name: Create file hello
file:
path: /tmp/hallo
state: touch
- name: Create file world
file:
path: /tmp/world
state: touch
im running the target, followed by the playbook container.
target:
docker run -d -p 2222:22 --name ansible_target -v ~/.ssh/id_rsa.pub:/home/ubuntu/.ssh/authorized_keys philm/ansible_target
playbook
docker run --link ansible_target --rm -it -v ~/.ssh/id_rsa:/root/.ssh/id_rsa -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub -v $(pwd):/ansible/playbooks philm/ansible_playbook -v playbook.yml
output:
PLAY [test] ********************************************************************
TASK [setup] *******************************************************************
fatal: [ansible_target]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}
PLAY RECAP *********************************************************************
ansible_target : ok=0 changed=0 unreachable=1 failed=0
any advice much appreciated
many thanks
trying to mount in the private key
but get the following error
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@ WARNING: UNPROTECTED PRIVATE KEY FILE! @\r\n@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0555 for \'/root/.ssh/id_rsa\' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis p
rivate key will be ignored.\r\nLoad key "/root/.ssh/id_rsa": bad permissions\r\nPermission denied (publickey).\r\n
docker-compose is using:
volumes:
- '.:/ansible/playbooks'
- "./id_rsa:/root/.ssh/id_rsa"
docker for windows
Hi! It's unclear from README if this image will allow to run local tasks, not remote. E.g. I have doubts that from container it would be possible to create local users, folders, etc. Please clarify this. I suggest adding to README some comments on this as well.
Thanks!
im a bit confused over the example. the test target container is called ansible_test but you link it as ansible_target. is this a simple typo or is it correct? where is ansible target defined?
~ docker-compose run --rm test remote.yml -i inventory MacBook-Pro [17:04:02]
ERROR! the playbook: remote.yml could not be found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.