Full Ansible Tutorial for Beginners: From Zero to Deploying Your First Playbook

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 126

  • @Pythoholic
    @Pythoholic  3 ปีที่แล้ว +3

    ⭐Full Ansible Tutorial for Beginners 2021: If you are a beginner or even if you have some kind of experience working in IT, this series will help you at every step in your goal towards pure automation with
    🎉 Slides on the channel are available here in the link below: www.ko-fi.com/pythoholic

  • @dhanashree318
    @dhanashree318 3 ปีที่แล้ว +2

    started with it, very clear explainations :). However difficullt to rewind in case you feel lost. You should have divided topic wise as most of the long youtube tutorials are.. so I can resume comfortably anytime.

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว +1

      There is a playlist you can refer ; please check that : th-cam.com/play/PLiH9_MU-6RjLIUCbpJv2xZc9zwLPkdyOY.html

    • @dhanashree318
      @dhanashree318 3 ปีที่แล้ว

      @@Pythoholic Thank you so much for responding. Does it have the same content as that of this tutorial?

  • @umakantmis833
    @umakantmis833 ปีที่แล้ว +1

    Its really very well designed with good and easy examples. Course material is really awesome. Trainer's presentation is really good. Its easy to understand the ansible once you complete this training. Thanks a lot.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      thanks 😊 for the support

  • @manuk2803
    @manuk2803 2 ปีที่แล้ว +3

    Such a clean and detailed explanation!!! Really Thankful to you !!

  • @anuragtiwary
    @anuragtiwary 11 หลายเดือนก่อน

    A little confusion: @40:20 you mentioned that Grinnding is a key value within which there are nested dictionary key:pair values and that will be represented just with an indentation (and not a hyphen) but at @43:25 despite of Milk being a dictionary (regardless if it's nested or not) why does it start with a hyphen ?
    Shouldn't it be more like this ?
    Ingredients:
    - Coffee
    - Flavour Liquid
    Milk: (without a hyphen)
    - Dominos
    - Low Fat
    - Toned

    • @Pythoholic
      @Pythoholic  11 หลายเดือนก่อน +1

      Thanks anurag
      Will check it and update if missing

  • @sandv2902
    @sandv2902 2 ปีที่แล้ว +1

    you can use ssh-keygen command instead of copy pasting the private key

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว +1

      Yes, thats right actually for beginners i wanted to keep it simple so that they can just understand the concept. But you are right

  • @mehransaeed7207
    @mehransaeed7207 ปีที่แล้ว

    Just a tip if managed node is unable to connect with control node even after adding the right permissions
    sudo nano /etc/ssh/sshd_config
    add the new user ansible (if created) into the allowed users bit

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      Yes thanks a lot Mehren...makes sense.. actually some users find it difficult. So we need to keep it simple for everyone.

  • @anoops7974
    @anoops7974 3 หลายเดือนก่อน

    Thank you so much. I learnt a lot on ansible.

  • @agni4869
    @agni4869 7 หลายเดือนก่อน

    awsome course and very clear explanation with aws. so much helpful

  • @samjellabilla4572
    @samjellabilla4572 2 ปีที่แล้ว

    This is very impressive and expressive removing a lot of stress and strain attached to this subject. Thanks for ajob well done.

  • @helloboris
    @helloboris 2 ปีที่แล้ว

    Thank-you very much for this explanation of the presentation of Ansible YAML. I gave been struggling to write working Ansible code because each example I see seems presents the code in a different format. I hope now that I can use your examples to properly explain to the Ansible processor what I want to do.
    Thanks again.

  • @DonJuanchito
    @DonJuanchito 3 ปีที่แล้ว +3

    Hi - is there a link to pay for the slides with US bank/CC/ or Paypal? I am not able to pay for them currently on your site

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว

      i have enabled PayPal, please check it again. Thanks for the support buymeacoffee.com/pythoholic

  • @jamesmcmahon2504
    @jamesmcmahon2504 ปีที่แล้ว

    Such a great tutorial - thank you so much! You are an excellent teacher.
    I do have a question though. I am accessing my ansible EC2 instance via Putty. I noticed that each time I log out of Putty and then later back in, I must re-execute the two commands 'ssh-agent bash', then 'ssh-add ~/.ssh/ec2-key.pem'. Is this because each shell that gets started needs to be told where the ssh key is before the ec2-to-ec2 connection can be made? Is there a preferred way to automate this as part of .bashrc or similar?
    Thank you again for this ansible tutorial.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      yes, please read this linuxhint.com/how_to_use_sshpass_to_login_for_ansible/
      www.devopsschool.com/blog/how-to-access-ansible-remote-machine-using-ssh-user-and-key/

  • @mdw4700
    @mdw4700 2 ปีที่แล้ว +1

    This is a nice course for Ansible, "isn't it?"

  • @aakashsonkusare69
    @aakashsonkusare69 3 ปีที่แล้ว +2

    Excited for Ansible! Sir, please cover Jenkins too.

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว

      Sure i will try and cover that as well .

    • @nagaraju-do9nm
      @nagaraju-do9nm 2 ปีที่แล้ว

      Please cover jenkins also

  • @panchalchetan0
    @panchalchetan0 ปีที่แล้ว

    Hi,
    can you please share some steps for Domain join playbook for linux and window server.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      OK Chetan I will check it and get back

  • @amansaurabh999
    @amansaurabh999 2 ปีที่แล้ว

    Greate tutorial. Thanks for the content. Can you please provide the link for security configuration that is required to communicate from one ec2 instance to another using ansible playbook. I mean without configuring it the host instances will not allow master node to access it.

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว

      Sure i will do that thanks for the feedback

  • @jakariaislamshanto1217
    @jakariaislamshanto1217 ปีที่แล้ว

    Thank you so much bro ! Nice explanation

  • @prafulshapamohan1851
    @prafulshapamohan1851 3 ปีที่แล้ว +1

    Nice video I will watch later thank you 😊

  • @Sumit2580-x
    @Sumit2580-x 3 ปีที่แล้ว

    Please cover on how Ansible can be used for network automation, this will be helpful for network engineers..
    Thanks

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว +2

      sure i will do that

  • @paravind2979
    @paravind2979 3 ปีที่แล้ว +2

    Amazing session💐💐
    Thank you once again😊

  • @prajwalbm7466
    @prajwalbm7466 ปีที่แล้ว

    Superbly explained the concept 🙏

  • @Supchik_b
    @Supchik_b 3 ปีที่แล้ว

    Wow! I think this will be awesome video. As usual 😉

  • @manojvishwakarma8480
    @manojvishwakarma8480 3 ปีที่แล้ว +1

    Hi, Which tool do you use to make these presentations ? Ms powerpoint or something else ?

  • @ps5Mariners
    @ps5Mariners 9 หลายเดือนก่อน

    Thanks for the effort

  • @emmanueloluwayemisi
    @emmanueloluwayemisi 2 ปีที่แล้ว

    How can i use this to monitor an IP for reachability and as well log outage/downtime/unreachability to that ip

  • @unedited159
    @unedited159 2 ปีที่แล้ว

    Really good explanation thanks.

  • @ashishpurohit3208
    @ashishpurohit3208 2 ปีที่แล้ว

    Thanks for this amazing video

  • @sgrhr024
    @sgrhr024 2 ปีที่แล้ว

    Amazing tutorial bro, Appreciate ur efforts

  • @333ksrikanth
    @333ksrikanth 9 หลายเดือนก่อน

    Thank you :)

  • @tejaswaghmare2525
    @tejaswaghmare2525 3 ปีที่แล้ว

    Will definitely watch it

  • @Chubbygirlyoutube
    @Chubbygirlyoutube 16 วันที่ผ่านมา

    Instead of AWS EC2 instances, I have installed 2 VMs with OS RHEL 9.4, but unable to install ansible in the servers.

    • @Pythoholic
      @Pythoholic  5 ชั่วโมงที่ผ่านมา

      To install Ansible on your RHEL 9.4 VMs, you can follow these steps:
      1. Enable the EPEL repository:
      sudo dnf install epel-release -y
      2. Install Ansible:
      sudo dnf install ansible -y
      If you run into any issues, make sure the VMs have internet access and are updated:
      sudo dnf update -y
      Try this and let me know if you need more help!

  • @maestro20001
    @maestro20001 ปีที่แล้ว

    Good tutorial, but the ads for your socials every 15 seconds are very distracting.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว +1

      Thanks for the feedback I will remove them

  • @saptarshiray531
    @saptarshiray531 2 ปีที่แล้ว

    Hi I have tried same with rehl in ec2 but it's not working in setup

  • @l.bilodeaupierre-r1456
    @l.bilodeaupierre-r1456 3 ปีที่แล้ว

    interesting Iam bilingual in French 🇨🇦 my friends wonder if they could also have it in French. anyway to translate your tutorials in French? website or apps ?

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว +1

      i will try and put the french captions

  • @pintubunty
    @pintubunty 3 ปีที่แล้ว

    Sir will u provide online class for devops

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว

      Sir all the training videos are on youtube only at the moment
      as and when if there is a online class plan i will update you

  • @rakhipatil2321
    @rakhipatil2321 2 ปีที่แล้ว

    Hi ,
    instead of atom if i am using pycharm then what plugins do i have to install . Can you please suggest .

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว

      same u can install json plugin
      ansible plugin

  • @shivamsinghverma
    @shivamsinghverma 3 ปีที่แล้ว

    Great session 👏

  • @avihayl7911
    @avihayl7911 ปีที่แล้ว

    Great tutorial! thank you so much :)
    You just need to get rid of the habit saying "isn't it" or add a counter at the top right 😅
    (I'm kidding, hopefully this passes through as a constructive criticism and not an insult)

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      hey thanks for the feedback. i will surely make it a point. 👍👍

  • @manuk2803
    @manuk2803 2 ปีที่แล้ว

    How can I solve 'missing sudo password' when run ad-hoc commands with -b flag?
    Please help!

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว

      you can pass it along with the cli command

  • @dotunemmanuel1900
    @dotunemmanuel1900 2 ปีที่แล้ว +1

    Hi, non of the payment link is working for me from US. Please enable paypal to give support.

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว

      i am working on a different gateway
      will update you guys once its done thanks for letting me know

  • @kkanu3833
    @kkanu3833 ปีที่แล้ว

    Nice video

  • @mohamedchennani5606
    @mohamedchennani5606 2 ปีที่แล้ว

    thanks

  • @johnk005297
    @johnk005297 ปีที่แล้ว

    Annoying pop-ups for subscription during the video. Screw that.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      Thanks john for the feedback
      Will keep in mind in the upcoming videos

  • @letsspeakbharath
    @letsspeakbharath 3 ปีที่แล้ว +1

    How to give a gift of token ?

    • @letsspeakbharath
      @letsspeakbharath 3 ปีที่แล้ว

      How to join into your channel ?? And what benefits I receive by joining ?

    • @Pythoholic
      @Pythoholic  3 ปีที่แล้ว +1

      There is a membership on the channel but its for the support (for now there are no benefits attached) but you will get a shoutout on multiple social media platforms. if you wish u can support the channel by membership paypal buymeacoffee

    • @letsspeakbharath
      @letsspeakbharath 3 ปีที่แล้ว +1

      @@Pythoholic it is using PayPal gateway ? Let me try it .

  • @olusholapacheco
    @olusholapacheco ปีที่แล้ว

    Hi, please at the 1hr 34 mark, a little confused on how to set the permissions after running ansible-playbook install_nginx.yaml I got a permission error.. Please can you direct me on what to do. Learning Ansible for the first time

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      This could be due to several reasons, and without the specific error message, I can only provide some general advice on what might be going wrong.
      1. **You might not have sufficient permissions on the local machine to execute the playbook.** Ansible playbooks should typically be executed as a user with sufficient permissions to write to the necessary directories and make the necessary system changes. If you're on a Unix-like system, you might need to use `sudo`:
      ```
      sudo ansible-playbook install_nginx.yaml
      ```
      2. **The remote user specified in your Ansible playbook might not have sufficient permissions.** Ensure the remote user has sufficient permissions on the target machine(s). If the tasks in your playbook require elevated privileges, you may need to include `become: yes` in your playbook to allow Ansible to execute tasks with sudo privileges.
      3. **The SSH keys might not have been properly set up on the remote machine(s).** If you're using SSH keys for authentication (which is recommended), make sure that the public key of the machine running the playbook is added to the `~/.ssh/authorized_keys` file of the remote user on the target machine(s).
      4. **File permissions on the playbook file itself might be incorrect.** Make sure you have the necessary read permissions on the `install_nginx.yaml` file. You can check this with `ls -l install_nginx.yaml` and set with `chmod` if needed. For example, `chmod 644 install_nginx.yaml` will ensure the file is readable.
      If you're still facing issues after checking these possibilities, please provide the specific error message you're seeing, and I'll be able to provide more targeted help.

    • @olusholapacheco
      @olusholapacheco ปีที่แล้ว

      @@Pythoholic I am using it on Termius, following your instructions as I go. But you didn't explain how to set permission at that point. I have all three EC2 like you do in the tutorial..

    • @olusholapacheco
      @olusholapacheco ปีที่แล้ว

      @@Pythoholic Thank you so much

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      OK then it's great not to worry, please set the permission for the key as chmod 400 keyname and please check the connectivity. Please do send the error messgae

    • @olusholapacheco
      @olusholapacheco ปีที่แล้ว

      @@Pythoholic Thank you so much for your time. I will send the error as soon as I get back to my pc. Thank you for your time and patienceb

  • @rajeshrao5099
    @rajeshrao5099 ปีที่แล้ว

    Super tutorial good if you made this series in putty also

  • @MVPMoe4ever
    @MVPMoe4ever ปีที่แล้ว

    When I declare the
    - name: Ansible copy file to remote server
    copy:
    src: '{{ base_path }}sample.txt'
    dest: '{{ base_path }}'
    HELP:- I am getting an ERROR! conflicting action statements: dest, src
    The error appears to be in '/home/ec2-user/install_nginx.yml': line 31, column 7, but may
    be elsewhere in the file depending on the exact syntax problem.
    The offending line appears to be:
    - name: Ansible copy file to remote server
    ^ here

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว +1

      I have updated the file now. Please check and let me know

    • @MVPMoe4ever
      @MVPMoe4ever ปีที่แล้ว

      @@Pythoholic Thank you so much. How do I access the file again. Will it let me re-download.

    • @MVPMoe4ever
      @MVPMoe4ever ปีที่แล้ว

      @Pythoholic, How do I re-access the file. Do I have to pay again or you have a repo.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว +1

      No it's totally free..please check pythoholic git repo

    • @MVPMoe4ever
      @MVPMoe4ever ปีที่แล้ว

      Thank you so much.

  • @c-bass413
    @c-bass413 4 หลายเดือนก่อน

    Great demo.

  • @kaal970
    @kaal970 2 ปีที่แล้ว

    I don't understand group variables totally

  • @jjaec952
    @jjaec952 2 ปีที่แล้ว

    I kinda wish you would have gone through everything, including creating the key. I got so lost and you spoke so fast. I was excited but that was not fun to try to figure out why nothing was working. I wish you gave more guidence.

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว

      Thanks for the feedback., i will surely improve on that.

  • @vivekselvam9064
    @vivekselvam9064 ปีที่แล้ว +1

    Hi brother, I'm getting the error "Could not open a connection to your authentication agent". While execute the command ssh-add ~/.ssh/ec2-key.pem. could you please check and share your feedback.

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      Sure vivek let me check and get back

    • @CasperWest
      @CasperWest ปีที่แล้ว

      i'm having the sam error

  • @SajinSeby
    @SajinSeby ปีที่แล้ว +1

    I am unable install ansible through termius as it is showing no command: amazon-linux-extras

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      I have installed it on AWS ec2 instance where AWS Amazon Linux extra is available

    • @SajinSeby
      @SajinSeby ปีที่แล้ว

      @@Pythoholic when i tried ' sudo amazon-linux-extras install ansible2 ' in termius, it shows 'sudo: amazon-linux-extras: command not found'

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      please run it on a ec2 instance

  • @builderbro1729
    @builderbro1729 2 ปีที่แล้ว +1

    fatal: [IPV4 address]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).", "unreachable": true}.
    Getting this error. Where exactly I went wrong in installing nginx service in Target1 instance from Master instance

    • @olumayoor
      @olumayoor 2 ปีที่แล้ว

      Me too! I tried the steps over and over, same error

    • @olumayoor
      @olumayoor 2 ปีที่แล้ว

      I just got it to work though by using the --key-file argument ansible-playbook install-nginx.yaml --key-file "ec2-key.pem" because the ec2-key.pem is located in the same folder as my playbook

    • @sandv2902
      @sandv2902 2 ปีที่แล้ว

      Same issue how did you resolved it??

    • @velagasainath
      @velagasainath ปีที่แล้ว

      Hi, were you able to establish connection with the ansible target from the main server??

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      Please change your key.permission
      Check the video on how to connect to ec2 instance
      Chmod 400 keyname

  • @vishuprasad3682
    @vishuprasad3682 8 หลายเดือนก่อน

    Hi, I am facing an issue. Could you please help for below error?
    ansible-playbook install_nginx.yaml -v
    No config file found; using defaults
    [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
    localhost does not match 'all'
    ERROR! '-name' is not a valid attribute for a Play
    The error appears to be in '/home/ec2-user/install_nginx.yaml': line 1, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
    The offending line appears to be:
    - name: Setup nginx server on myserver list (host group)
    ^ here

    • @Pythoholic
      @Pythoholic  8 หลายเดือนก่อน

      It looks like there's a syntax error in your Ansible playbook. In Ansible, the correct syntax for defining a play is to use a hyphen followed by a space before the `name` attribute, like this:
      ```yaml
      - name: Setup nginx server on myserver list (host group)
      hosts: your_host_group
      tasks:
      - name: Install Nginx
      yum:
      name: nginx
      state: present
      ```
      Make sure that you have a hyphen (`-`) followed by a space before the `name` attribute at the beginning of your play. Also, ensure that you specify the `hosts` field to define which hosts or groups the play should target. If you want to target all hosts, you can use `hosts: all`.
      Here's a corrected version of your playbook:
      ```yaml
      - name: Setup nginx server on myserver list (host group)
      hosts: your_host_group
      tasks:
      - name: Install Nginx
      yum:
      name: nginx
      state: present
      ```
      Replace `your_host_group` with the appropriate group name or `all` if you want to target all hosts in your inventory. If you're using a different package manager (like `apt` for Debian-based systems), make sure to adjust the task accordingly.

  • @sandeep2prince
    @sandeep2prince ปีที่แล้ว

    This is regarding the ping command "ansible ansible-target-1 -m ping -i inventory.txt".
    I have followed the video and I was able to ping the other servers from Ansible master servers. But if I logout of the Ansible-master server and again log in and try the ping command the ping gets failed with the below message.
    "ansible-target-3 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).",
    "unreachable": true"
    Only after I add the .pem key to the .ssh folder again the ping gets successful.(This is even after having the ec2-key.pem file in the .ssh folder)
    ssh-agent bash
    cp ec2-key.pem ~/.ssh/
    ssh-add ~/.ssh/ec2-key.pem
    I feel this is a Linux issue. Can someone explain me why this is happening?

    • @Pythoholic
      @Pythoholic  ปีที่แล้ว

      Yes it doesnt save the state
      so we need to push the key in ssh
      its just for a demo so that we can see how it could be done on more than one machine.

  • @darjichirag235
    @darjichirag235 8 หลายเดือนก่อน

    Such a clean and detailed explanation!!! Really Thankful to you !!😊

  • @AkshayKumar-re3bf
    @AkshayKumar-re3bf 2 ปีที่แล้ว +1

    which vm should i use in case, Iam using azure cloud provider?

    • @Pythoholic
      @Pythoholic  2 ปีที่แล้ว +1

      You can use this : azure.microsoft.com/en-us/products/virtual-machines/