Chapters
30 Chapters
|
2:45:48
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: >=5.5.9
Subscribe to download the code!Compatible PHP versions: >=5.5.9
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
04.
Vagrant <3's Ansible
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
This tutorial is built using an older version of Symfony, but the core concepts of Ansible are still valid. New versions of Ansible may contain some features that we don't use here.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*", // v3.1.4
"doctrine/orm": "^2.5", // v2.7.2
"doctrine/doctrine-bundle": "^1.6", // 1.6.4
"doctrine/doctrine-cache-bundle": "^1.2", // 1.3.0
"symfony/swiftmailer-bundle": "^2.3", // v2.3.11
"symfony/monolog-bundle": "^2.8", // 2.11.1
"symfony/polyfill-apcu": "^1.0", // v1.2.0
"sensio/distribution-bundle": "^5.0", // v5.0.12
"sensio/framework-extra-bundle": "^3.0.2", // v3.0.16
"incenteev/composer-parameter-handler": "^2.0", // v2.1.2
"doctrine/doctrine-migrations-bundle": "^1.2", // v1.2.0
"snc/redis-bundle": "^2.0", // 2.0.0
"predis/predis": "^1.1", // v1.1.1
"composer/package-versions-deprecated": "^1.11" // 1.11.99
},
"require-dev": {
"sensio/generator-bundle": "^3.0", // v3.0.8
"symfony/phpunit-bridge": "^3.0", // v3.1.4
"doctrine/data-fixtures": "^1.1", // 1.3.3
"hautelook/alice-bundle": "^1.3" // v1.4.1
}
}
19 Comments
Hi!
Is possible that you have a error like this when you exec $ ansible vb -m ping -i ansible/hosts.ini:
[Solution]
brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb
x2
Hey Juan,
Hm, that's interesting. As I understand, you are on Mac as me, but I do not have the problem you mentioned. Moreover, I do not have sshpass program installed, but "$ ansible vb -m ping -i ansible/hosts.ini" works well for me without any errors :/ The only ssh-related package I installed with Brew is "ssh-copy-id" - probably that's the key in my case.
Anyway, thanks for sharing your solution with others!
Cheers!
Hello victor , I've published a comment in https://knpuniversity.com/s... but Disqus says that is a SPAM comment!
I don't put any link external or strange thing....
Hey Juan,
Woops, looks like your message was considered as possible spam by Disqus, probably because it's pretty long ;) No problem, we look over our spam Disqus comments from time to time. I just approved your message.
Cheers!
Oh Thanks!
Yes, a petty long! jeje
Hey Victor,
Yes I'm using a mac.
Cheers!
In case the
`ssh vagrant@192.168.33.10
`command fails with
ssh vagrant@192.168.33.10 -o PubkeyAuthentication=no
`And to overcome the same error with ansible - append this to your ~/.ssh/config:
Hey Ivan,
Thank you for sharing this solution with others!
Cheers!
After running into a few issues like getting the error "ValueError: insecure string pickle" using the ansible 2.4.2.0 discovered that it needs the sshpass library installed, you can use homebrew to install it but needed some extra googling to make it work on OS X, https://gist.github.com/aru...
Hey Vadim,
Thanks for sharing your solution! I'm on Mac, and looks like I don't have sshpass lib installed, but I have never seen the error you mentioned. I have Ansible 2.4.1.0 installed, not sure it's due to patch version difference with your version, so I wonder what did you do to see that error? Thanks!
Cheers!
Hey @diego82 ,
You share awesome examples with us, thanks a lot! Yeah, "[vb:vars]" is nice solution, I like this way because we don't need to write all the parameters in a one line, so it increases readability! But keep in mind that all those variables apply to the all hosts listed in [vb], which is not a problem for now though.
What about "ansible_python_interpreter" parameter - interesting idea! I haven't tested it yet, does it mean that we don't need to install "python-apt" package at all, right? If so - it's very sweet!
P.S. Nice trick with "host_key_checking = False" ;)
Cheers!
Haha, don't worry about spamming, we always welcome good comments! ;)
That's great, we'll add a note with a few steps about how to use Ubuntu 16.04 box instead of 14.04 one - thanks to your comments.
Cheers!
Yo there!
Thanks for the notes! I have a few questions:
1) On Ubuntu 16.4, was python-apt not already installed (is that why you installed it)? If not, we can add that as one of the first tasks in our playbook :).
2) You're right about there being a slightly better to use this :). We can set the private key in our hosts file:
Try this out - let me know if it works! And based on your answers, I can add some notes to the tutorial! It would be nice to mention some of the important differences on other versions of Ubuntu.
Cheers!
This works great! The other way I was getting an error about sshpass not being installed. I'm doing this from the Unix subsystem in Windows 10.
Awesome, thank you for letting us know this was the right way! :)
Hey @diego82 ,
Thank you for the kind words! Really, Ansible is much easier than Chef and quite fun )
And yes, we'll do some interaction with AWS like creating EC2 instance with Ansible and deploy app to it at the end of this course, so stay tuned with us ;)
Cheers!
It makes sense to use ansible with Docker, or the dockerfile is the same thing that ansible does?
Hey Roberto Briones Argüelles!
Good question :). And other people have had the same question - check out my answer here: https://knpuniversity.com/s...
Cheers!
"Houston: no signs of life"
Start the conversation!