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

Updating for 2022 #3

Open
ChadDa3mon opened this issue May 19, 2022 · 2 comments
Open

Updating for 2022 #3

ChadDa3mon opened this issue May 19, 2022 · 2 comments

Comments

@ChadDa3mon
Copy link

Greetings,

I came across your article on medium.com and loved what you had, I was so excited to fire this up and check things out as I'm trying to learn Ansible, Vagrant, and Jenkins for my new job. I was sad to see I had similar issues to the other users who have posted issues.

I understand people get busy and you may not be able or willing to update this. I'd like to help as I could stand to learn a good deal from this project, but I'm a bit too novice to make heads or tails of things. If you wouldn't mind giving me some pointers to help get me started, I'd appreciate it. If I can get this working, I'll submit a PR so this can get updated.

The issue I have is the same as this issue. I'm running on MacOS Monterey with Vagrant 2.2.19. If I can get past this issue, then I can work on what @n00b78 suggested in their issue.

  <snip>
    ansible.sample.com: [jenkins]
    ansible.sample.com: jenkins.sample.com
    ansible.sample.com:
    ansible.sample.com: [docker]
    ansible.sample.com: docker.sample.com
    ansible.sample.com:
    ansible.sample.com: [gitlab]
    ansible.sample.com: gitlab.sample.com
    ansible.sample.com: dos2unix: /home/vagrant/artefacts/scripts/ssh_pass.sh: No such file or directory
    ansible.sample.com: dos2unix: Skipping /home/vagrant/artefacts/scripts/ssh_pass.sh, not a regular file.
    ansible.sample.com: chmod: cannot access ‘/home/vagrant/artefacts/scripts/ssh_pass.sh’: No such file or directory
    ansible.sample.com: /tmp/vagrant-shell: 117: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: /tmp/vagrant-shell: 119: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: /tmp/vagrant-shell: 121: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: /tmp/vagrant-shell: 123: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: /tmp/vagrant-shell: 125: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: /tmp/vagrant-shell: 127: /tmp/vagrant-shell: /home/vagrant/artefacts/scripts/ssh_pass.sh: not found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/nfs_server.yaml could not be found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/nfs_clients.yaml could not be found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/install_java.yaml could not be found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/install_jenkins.yaml could not be found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/install_docker.yaml could not be found
    ansible.sample.com: ERROR! the playbook: /home/vagrant/artefacts/playbooks/install_gitlab.yaml could not be found

I assume the vagrant file is trying (or should be trying) to execute the dos2unix commands on the ansible host we created, but it is failing. I'm not sure how your script knows to execute these on the host. I assume maybe something has changed with how Vagrant handles things since the version you used when you first wrote this.

Any help you can give would be greatly appreciated. Even if you don't have the time (and I understand if you don't) thanks for taking the time to write your article and set this up.

@ChadDa3mon
Copy link
Author

I logged into the ansible.sample.com host to see what was in /home/vagrant

vagrant@ansible:~$ ls
config  playbooks  scripts  templates

Your script is trying to find a /home/vagrant/artefacts folder which isn't on the host at all. I'm not sure what mechanism was responsible for putting this there back when you created this, but it seems to have failed.

@ChadDa3mon
Copy link
Author

I was able to hack the configure_ansible.sh and added a bit to copy /vagrant/artefacts to ~

This got the script to proceed quite a bit further, but eventually it all fell apart with Oracle and Gitlab as things are just too old.

# Copy /vagrant/artefacts to ~ (where configure_ansible.sh is set to look)
# Yes - This is a very lazy fix.
cp -r /vagrant/artefacts ~vagrant/

#cat /etc/ansible/hosts
dos2unix ~/artefacts/scripts/ssh_pass.sh
chmod +x ~/artefacts/scripts/ssh_pass.sh
#chown vagrant:vagrant ssh_pass.sh

New Errors

ansible.sample.com: fatal: [jenkins.sample.com]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "Failed to validate the SSL certificate for pkg.jenkins.io:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine  (the python executable used (/usr/bin/python) is version: 2.7.6 (default, Nov 13 2018, 12:45:42) [GCC 4.8.4]) or you can install the `urllib3`, `pyOpenSSL`, `ndg-httpsclient`, and `pyasn1` python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was: hostname 'pkg.jenkins.io' doesn't match 'd.sni.fastly.net'.", "status": -1, "url": "https://pkg.jenkins.io/debian-stable/jenkins.io.key"}
    ansible.sample.com: TASK [Install GitLab repository] ***********************************************
    ansible.sample.com: fatal: [gitlab.sample.com]: FAILED! => {"changed": false, "msg": "Failed to validate the SSL certificate for packages.gitlab.com:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine  (the python executable used (/usr/bin/python) is version: 2.7.6 (default, Nov 13 2018, 12:45:42) [GCC 4.8.4]) or you can install the `urllib3`, `pyOpenSSL`, `ndg-httpsclient`, and `pyasn1` python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was: [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure.", "status": -1, "url": "https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh"}

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

1 participant