Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Webserver using Ansible Issue #4

Open
skrskr opened this issue May 17, 2022 · 4 comments
Open

Setup Webserver using Ansible Issue #4

skrskr opened this issue May 17, 2022 · 4 comments

Comments

@skrskr
Copy link

skrskr commented May 17, 2022

i'm setting up a web server in an EC2 using ci / cd circleci.
but get always get error

ansible-playbook -i inventory.txt main-remote.yml

Error from CircleCi

PLAY [Exercise for setting up a web server in an EC using ci / cd circleci] ****

TASK [Gathering Facts] *********************************************************
fatal: [54.196.240.122]: UNREACHABLE! => {"changed": false, "msg": "unpack requires a buffer of 4 bytes", "unreachable": true}

PLAY RECAP *********************************************************************
54.196.240.122             : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   

Exited with code exit status 4
@CFCIfe
Copy link

CFCIfe commented Jul 16, 2022

Same here. Can anyone help with a solution.

@CFCIfe
Copy link

CFCIfe commented Jul 21, 2022

Solution is to install openssh in your image or use a recent Python image

@mahmoud-lembo
Copy link

as per @CFCIfe comment,
updating docker image to
- image: python:3.9-alpine3.16
fixed it

mahmoud-lembo added a commit to mahmoud-lembo/nd9991-c3-hello-world-exercise-solution that referenced this issue Sep 18, 2022
@Ahmed-Moourad
Copy link

Ahmed-Moourad commented Jan 8, 2023

I have solved it using another docker image also you will need to change the ansible install command:
``
#Exercise: Config and Deployment
configure_infrastructure:
docker:
- image: circleci/python:3.8
steps:
- checkout
- add_ssh_keys:
# You can get this ID in the section where you registered the SSH Key
fingerprints:
- "yo:ur:fi:ng:er:pr:in:ts"
- run:
name: Install Ansible
command: |
pip install ansible
- run:
name: Run Playbook and Configure server
command: |
ansible-playbook -i inventory.txt main.yml

``
my solution

if you need lighter image an faster in your Circle CI use the image mentioned by Mahmoud :- image: python:3.9-alpine3.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants