G'day everyone, if you're currently learning Ansible and want to see how all these modules fit together to build something useful, please consider checking out my course and letting me know what you think! It's currently in "early access" while I finish off the last chapter, and the first part of the course is free so you can try it out: learn.toptechskills.com/courses/productive-with-ansible. Thanks for all your support and happy coding!
@bhupendrasinghsuri4964 ай бұрын
Thanks for sharing. Like to see more content on Ansible...
@karthickbaskar68865 жыл бұрын
Astonished with your clarity of teaching. Thanks to you.
@SaravanaKumar-tz7ge4 жыл бұрын
As a beginner, it is Really Useful for me sir !!!. Thank you:)
@toptechskills4 жыл бұрын
Thank you for your comment, so glad it was useful for you 🙏
@shrashthiagarwal71085 жыл бұрын
Great Content !! Kindly prepare and share complete series to learn Ansible. This will really help !!
@toptechskills5 жыл бұрын
Thanks Shrashthi Agarwal, I am working on a Udemy course about Ansible in my spare time and I hope to release it as soon as I can. Thanks for your support.
@chinnapaladugu72455 жыл бұрын
It's really awesome 😊..I m expecting more videos on different useful modules and ansible roles ..keep going awesome 👍👌
@toptechskills5 жыл бұрын
I'll do my best to make more useful content ASAP, thank you for your comment
@purnimashanti264 жыл бұрын
Very good explanation.. Pls upload more videos on ansible modules and roles.. Thank you.
@toptechskills4 жыл бұрын
Thank you, will do!
@rahul_raj74 жыл бұрын
I like your videos and the way you explain is great..👍👍 Do more hands-on example Thanks
@sameerthorappa33565 жыл бұрын
very good video excellent quality crystal clear voice .. moreover great content...
@toptechskills5 жыл бұрын
Thank you for your comment Sameer, hope the video helped you out!
@raphaelaraujo47904 жыл бұрын
Thanks for the video! Is possible to run command module and issue database statements like INSERT INTO?
@toptechskills4 жыл бұрын
Hi Raphael, yes that should certainly be possible. The `command` and `shell` modules can do pretty much anything you can do if you were using the shell directly. Running `mysql` commands directly from the command line is certainly possible: stackoverflow.com/questions/39215064/insert-into-mysql-from-bash-script.
@metalmasterlp6 жыл бұрын
Your videos are awesome, keep it up
@toptechskills6 жыл бұрын
Hi metalmasterlp, thanks for the huge compliment, glad you enjoyed it. I'll do my best to keep useful tutorials coming out regularly.
@chikkusingh4604 жыл бұрын
How can we achieve round robin strategy while deploying an app with ansible on multiple servers ?
@toptechskills4 жыл бұрын
Hi Chikku, I answered this question on other comment, hopefully it works for you, thanks.
@sujithreddy50324 жыл бұрын
can you please tell how to make command module idempotent
@toptechskills4 жыл бұрын
Hi sujith reddy, the `command` module doesn't really have any idempotence checks built in, but you can use things like the `creates` argument to the `command` module (docs.ansible.com/ansible/latest/modules/command_module.html). This argument lets you run the command only when the file *doesn't* exist. This gives you some level of idempotence, but it only covers a small section of use cases. Generally if you want your command to be idempotent, you need to do it within the command itself (i.e. use conditionals in your command to only make changes in certain circumstances). You can then use the `changed_when` argument to make sure the task only reports a change in circumstances where something actually changed. Another thing I do often is to use the `when` parameter to only run the command in certain cases. Hope this helps, thanks for your comment.
@willreid78352 жыл бұрын
when I try to run command module the tasks are skipped. Any idea what I am missing?
@toptechskills2 жыл бұрын
Can you show the full task YAML?
@ahsan-li7sh6 жыл бұрын
Could you please make a video how to deploy apache spark on docker containers using ansible. I haven't find any good resource
@toptechskills6 жыл бұрын
Hi Ahsan, great suggestion, thank you. I need to spend some time upskilling with regard to containerized applications over the next few weeks (Docker, Kubernetes, ECS, etc.), especially how it relates to Ansible. Hopefully I can start making some videos about these aspects soon.
@lionaldo81594 жыл бұрын
How can we use diff command and store the changes in file?
@toptechskills4 жыл бұрын
Hi LioNaldo, you can use the `shell` module and pipe (or tee) the results of the diff command into a file, just like you would in the shell. The other way would be to use the `register` argument to store the output from `command` as a variable and then use the `copy` module to write the stdout into a file: - www.toptechskills.com/ansible-tutorials-courses/ansible-command-module-tutorial-examples/#how-to-capture-command-module-output - www.toptechskills.com/ansible-tutorials-courses/ansible-copy-module-tutorial-examples/#how-to-write-plain-text-into-a-file-on-the-remote-host-with-copy Hope that helps, thanks for your comment!
@ChazRagg5 жыл бұрын
i am looking to autpmatically install docker on a series of raspberry pi's, i use the "curl -sSl get.docker.com | sh" would this be the best modual to use or is there a more efficient way of doing this ?
@toptechskills5 жыл бұрын
Hi chazragg, I'd suggest using a role from Ansible Galaxy, such as Jeff Geerling's "docker" role: galaxy.ansible.com/geerlingguy/docker In general, these roles are very well tested and well maintained. If your Raspberry Pi is running a non-standard distribution, the role may not work by default, but it will give you a good starting point if you need to modify the role to make it work. Hope this helps, thanks!
@jackcsprat5 жыл бұрын
Hello, nice video !! Can you tell me how to install the command module please ? When I attempt to use the command module with like mkdir, ansible complains that command is not there.
@toptechskills5 жыл бұрын
Hi jackcsprat, the command module is an Ansible core module, so if you have Ansible installed you will have it available. If you share the error message with me I can help you debug what's going on.
@jackcsprat5 жыл бұрын
@@toptechskills I created a file called demoplays.yaml as follows. I then created a host file that has [groupA] and then the hostname. I then issue the command: ansible-playbook -i hosts demoplays.yaml and get an error of: ERROR! 'command' is not a valid attribute for a Play --- - hosts: groupA tasks: - name: find disk space available command: df -h
@toptechskills5 жыл бұрын
Hi @jackcsprat, I think the error here is your indentation. YAML is sensitive to whitespace and it looks like your `command` keyword us at the same level of indentation as the `tasks` keyword, which would make YAML interpret it as part of the play, rather than the task. Try the following (just fixed the indentation): --- - hosts: groupA tasks: - name: find disk space available command: df -h See if that works and if so, just make sure you are careful with indentation in YAML.
@jackcsprat5 жыл бұрын
@@toptechskills You were absolutely correct Percy !! Thank you so much !!
@sameerthorappa33565 жыл бұрын
is it possible to use command module with network devices ? i mean with Cisco/Huawei routers and switches ?
@toptechskills5 жыл бұрын
Hi Sameer, thanks for your comment. The `command` module is targeted at Linux and Windows operating systems, so usually won't work on networking hardware, however there are specialized "command" modules for some network hardware transports. The full list of modules for network devices is available here: docs.ansible.com/ansible/latest/modules/list_of_network_modules.html#. If you search for "command" on this page, you'll see the command modules for specific network hardware transports. As I understand it, the specific transport will depend on the exact model of the networking hardware, not just the brand.
@alex_ventura3 жыл бұрын
Wow man, how can you make it look so easy to learn Ansible? You’re really good at sharing knowledge, congrats! And now that you were talking about Ruby on Rails, I was wondering if you have a good way to installs RVM using Ansible? I’ve been trying without any look to accomplish it! Thanks I’m advanced!
@toptechskills3 жыл бұрын
Hi Alex, firstly thank you for your comment. Regarding installing RVM using Ansible, there are a few approaches I can suggest: 1. You can use the Ansible Galaxy role for RVM directly (galaxy.ansible.com/rvm/ruby). You can learn more about how to use Galaxy roles here: galaxy.ansible.com/docs/using/installing.html#roles 2. You can take a look at how the Ansible Galaxy role for RVM is implemented in the Github repo (github.com/rvm/rvm1-ansible/blob/master/tasks/main.yml) and replicate something similar yourself. 3. Look at the RVM documentation directly and convert each step of the installation instructions into a Ansible task: rvm.io/rvm/install Hope that helps, thanks!
@alex_ventura3 жыл бұрын
@@toptechskills Yeah, I’ve been trying to install RVM in different ways without any luck. I’ve created a script that gets transferred to the server and then gets executed by Ansible in the server but it doesn’t work. I even have tried to use galaxy role but it seems not to work for me and maybe I’m doing it wrong but what I found is my major problem is the fact that Ansible does not run commands as a login shell and RVM is all about it. I feel kind of frustrated but I’ll keep trying to have it running and if you have any other suggestions or you find it worth, please create a video for doing this. Thanks in advance bro! 👍🏻
@toptechskills3 жыл бұрын
The problem you're describing is pretty common with things like package managers that install themselves into your `.bash_profile`/`.bashrc` files or equivalents for other shells. In general you can replicate this in Ansible by adding the RVM PATH to your `$PATH` for the shell environment like this: - name: Run some command with RVM command: gem install ... environment: PATH: "{{ ansible_env.PATH }}:/path/to/rvm/bin" (replace `/path/to/rvm/bin` with the path to where your RVM shims are installed).
@alex_ventura3 жыл бұрын
@@toptechskills Thanks so much Percy, I’m going to try that out!
@SurajKumar-bm6fo4 жыл бұрын
Thanq so much sir
@nL-ve4gi4 жыл бұрын
vi thanks_PG The practice is wow ! I got ,what l was expecting? Thanks and keep uploading cat thanks_PG
@datworks33196 жыл бұрын
nice tutorial. can you tell me what editor are you using?
@toptechskills6 жыл бұрын
Hi Dat Works, thanks for the comment. I'm using Visual Studio Code with the Ansible plugin by Microsoft. code.visualstudio.com marketplace.visualstudio.com/items?itemName=vscoss.vscode-ansible Thanks for watching!
@kanwarpreetsingh48195 жыл бұрын
@@toptechskills What is the theme you are using?
@hprangana3 жыл бұрын
thanks a lot
@toptechskills3 жыл бұрын
Thanks for your kind comments Isuru 🙏
@monday67405 жыл бұрын
1:22 Well, no - you can't see that file being created by touch, you can see the file is there. That is a massive difference ... A lot of programming bugs come out of assumptions, here you are showing an example that is assuming things.
@toptechskills5 жыл бұрын
Thanks for your comment Mon Day, that's a great point, I didn't show that the file didn't exist before running the command, next time I could make that clear before running the playbook.