[16:05:04] [## Class Started at Thu Aug 11 16:05:04 2016 ##] [16:05:04] #startclass [16:05:05] ! [16:05:22] Onkar Karale [16:05:23] Roll call please [16:05:25] Saurav Saha [16:05:29] Abhishek Shrivastava [16:05:31] Rohan Hazra [16:05:32] shweta suman [16:05:33] K Sai Kiran [16:05:33] Harsh Vardhan [16:05:34] Pooja Yadav [16:05:36] Avinash Madhukar [16:05:37] Gobinda Akhuli [16:05:38] Akash Mishra [16:05:43] Mriyam Tamuli [16:05:46] Anupama Mandal [16:05:51] Radhika Arora [16:05:51] Priyanka Ambre [16:05:52] Amol Kahat. [16:05:53] Mahendra Yadav [16:05:53] Mamoon Manzoor [16:05:58] Mudit Maurya [16:06:01] Shashank Aryan [16:06:01] sandeep kumar choudhary [16:06:01] Rahul Bhattacharjee [16:06:03] Moiz Sajid [16:06:03] Yashwanth M [16:06:07] Aniket Khisti [16:06:13] Prashant Jamkhande [16:06:14] Shantanu Acharya [16:06:15] Abhishek Rai [16:06:16] Mahesh [16:06:23] poonam jadhav [16:07:09] Deepanshu kapoor [16:07:32] abstatic, sshpass is not installed :D [16:07:44] chshbh, i got it working after installing sshpass [16:07:58] Avik mukherjee [16:08:32] Alright so let's begin. [16:08:40] Anushil Kumar [16:08:46] Pabitra Pati [16:08:58] Kshitij [16:09:00] How many of you already know about ansible (it is fine if you know little bit)? [16:09:36] I am totally new. Heard the term second time today [16:09:37] Sayan Chowdhury [16:09:55] I am also totally new to it [16:09:55] So looks like most of folks are newbie here. [16:10:07] Never heard of it [16:10:13] No i don't know , totally new [16:10:13] I am totally new.no idea [16:10:19] I know tids and bits :) [16:10:20] Little bit. [16:10:35] no idea [16:10:37] I am new as well [16:10:51] So we will do a very basic session today and then some more stuff in another session. [16:11:01] Demo video helped a little [16:11:02] No idea, but heard the name before [16:11:05] Totally new ! Heard never tried to do research ! Never googled [16:11:13] I am also new to it. [16:11:24] Ansible is used to automate IT deployments [16:11:44] Did everyone have it install in system? [16:11:58] yes [16:12:00] yes [16:12:00] yes [16:12:11] yes [16:12:11] Yes. [16:12:12] praveenkumar: I installed it using the ppa using apt-get in ubuntu. Is it fine ? [16:12:14] yes [16:12:15] Yes. [16:12:16] yep [16:12:21] yes, but how to test it work or not [16:12:21] yes [16:12:23] Yup [16:12:23] yeah [16:12:25] yes [16:12:33] yes [16:12:42] yes [16:12:44] yes [16:12:44] no. :( [16:12:51] Yes [16:12:58] No [16:13:06] No [16:13:12] SRvSaha: yes that fine. [16:13:22] Ok thanks praveenkumar [16:13:51] folks who didn't install it can you do it fast. meanwhile I will ask some questions which will setup our expection about this tool. [16:15:38] So if you folks check what ansible is then you will find => Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. [16:15:48] I am not able to install ansible tower [16:15:58] It asked me to fill some form [16:16:01] deep123k: who told you to install tower? [16:16:14] Link was of ansible tower [16:16:27] In mailing list [16:16:58] praveenkumar, is it kind of powerful version of docker ? [16:17:23] deep123k: doesn't http://docs.ansible.com/ansible/intro_installation.html# is in the ML? [16:18:07] Praveenkumar query solved [16:18:13] Thanks vharsh [16:18:17] shobhit upadhyay [16:18:20] deep123k: which Mailing list you were looking to? [16:18:33] Dgplug [16:18:36] abstatic: no it's not powerful version of docker [16:18:39] It had two links [16:18:47] I opened first one [16:19:00] deep123k: you have to read that mail carefully [16:19:23] praveenkumar thanks query solved [16:19:36] roll call : JOgender Kota [16:19:52] sorry for late :( [16:19:53] Anyway can anyone of you list down what you folks usually do after installation of a operating system (assume you install fedora today what next)? [16:20:29] I install all of the software that I require for my development needs like compilers, editors, settings etc [16:20:38] I run my bash script to set up chrome, mplayer, zsh, docker, sublime text etc. [16:20:41] 1. Install the most important softwares [16:20:49] Roll call: Aniketh Girish [16:20:50] 2. Do some settings. [16:21:03] 3. Get our customization [16:21:16] update the system [16:21:19] I run the update [16:21:24] look into you tube for tips and tricks of the os, if its unknown to me [16:21:27] paraveen kumar, sorry for being late. I have installed ansible. [16:21:39] mbtamuli12_: How do you maintain your set-up in bash scripts ? [16:21:40] rpm [16:21:57] Alright so let me put a list here. [16:22:08] 1. Update our distro [16:22:22] SRvSaha, since session is going on, we can continue in pm. [16:22:22] 2. Setup a repository which might not there default [16:22:41] 3. Install required software [16:22:58] 4. Do some config changes if a software require [16:23:06] mbtamuli12_: Ok, sure. May be after the session [16:23:19] Roll Call: Tummala Dhanvi [16:23:25] 5. Start a service which we want to run (like httpd, mysql ..etc) [16:24:21] Now assume we have to do it for 100 machine is it feasible to do it manually to each machine? [16:24:37] no [16:24:38] No [16:24:38] No [16:24:42] ohh [16:24:43] rohan_ is now known as rohan_h [16:25:03] no [16:25:12] no [16:25:33] So ansible comes in the picture here, it do other lot more stuff but let's we discuss about how it will configure our system. [16:27:06] Roll Call : Aman Kumar [16:27:15] which version of ansible you folks have ( try to execute $ ansible --version) [16:27:29] 1.9.2 [16:27:36] 2.1.1.0 [16:27:42] 2.1.1.0 [16:27:42] ansible 2.1.1.0 [16:27:48] ansible 2.1.1.0 [16:27:51] Sorry for being late. :( Can anyone please tell me whats going on ? [16:27:51] ansible 2.0.0.2 [16:27:53] 2.1.1.0 [16:27:55] 2.1.1.0 [16:28:05] 1.9.2 [16:28:06] 2.1.1.0 [16:28:09] ansible 2.1.1.0 [16:28:10] 2.1.1.0 [16:28:13] 2.2.0 [16:28:13] 2.1.1.0 [16:28:20] ansible 2.1.1.0 [16:28:26] 2.2.0 [16:28:30] 2.0.0.2 [16:28:35] 2.1.1.0 [16:28:36] aman install ansible in your system and follow here [16:28:46] 2.1.1.0 [16:28:53] 2.1.1.0 [16:29:16] ansible 1.5.4 [16:29:27] cosmologist10: that's way to old [16:29:33] 2.1.1.0 [16:29:45] updated it to 2.1.1.0 [16:29:45] cosmologist10: can you upgrade to 2.x? [16:30:12] okay! i am upgrading... [16:32:00] praveenkumar, ansible 2.1.1.0 config file = /etc/ansible/ansible.cfg [16:32:01] configured module search path = Default w/o overrides is it ok or I have to do any thing [16:32:19] now can you folks add your local system ssh key => execute $ ssh-copy-id @127.0.0.1 ? [16:32:57] yes [16:34:09] praveenkumar, is it okay if I am using a VM? I have the ssh-key authentication set up already. [16:34:15] praveenkumar: Do I need to enable remote login with passwords? I have it disabled. [16:34:26] praveenkumar: I am getting error :/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed [16:34:34] Error /usr/bin/ssh-copy-id: ERROR: ssh: connect to host 127.0.0.1 port 22: Connection refused [16:34:44] So it shows "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)." [16:34:45] mbtamuli12_: that will work [16:35:05] LambaInsaan: Install openssh-server [16:35:06] vharsh: no let it be ssh enabled only [16:35:24] vharsh, Alright! [16:35:56] Already installed. [16:36:03] SRvSaha: can you do ssh @127.0.0.1 ? [16:36:06] LambaInsaan: Fedora? [16:36:14] LambaInsaan: Pm. [16:36:14] vharsh, Yes. [16:36:24] LambaInsaan: if installed start the ssh server [16:36:31] LambaInsaan: can you able to ssh to your VM with ssh keys only? [16:36:32] s/server/service/ [16:36:56] LambaInsaan: sudo service restart sshd ? [16:37:25] praveenkumar: Nope, I am still getting the connection refused error [16:37:29] (to install the contents of '/home/hydro/.pub' anyway, look at the -f option) [16:37:46] (to install the contents of '/home/hydro/.pub' anyway, look at the -f option) [16:37:53] praveenkumar: srvsaha@XcidCruX:~$ ssh srvsaha@127.0.0.1 ssh: connect to host 127.0.0.1 port 22: Connection refused [16:37:55] sayan, How to start SSH server? [16:38:14] ' systemctl sshd start' ? [16:38:22] Same error as hydro [16:39:23] It's working now! :) [16:39:24] LambaInsaan: yes [16:39:30] Thanks to vharsh [16:39:56] praveenkumar, ssh-copy-id wasn't working. ssh @... worked. [16:40:01] Alright let's try to execute $ ansible all -i "localhost," -c local -m ping [16:40:04] SRvSaha: start the ssh service [16:40:19] usr/bin/ssh-copy-id: ERROR: failed to open ID file '/home/hydro/.pub': No such file or directory [16:40:30] LambaInsaan: swap the sshd with start :p and run it as root :) [16:40:53] bash: @127.0.0.1: Permission denied . What should i do ? [16:40:55] SRvSaha, fixed your error? i am getting the same error :V [16:41:06] sayan: How to start ssh service ? [16:41:16] SRvSaha: which OS? [16:41:28] got disconnected. what to do after naming the version? [16:41:38] hydro: do you have ssh keys created? [16:41:39] Anupama: Pm [16:41:52] UBUNTU [16:41:54] Sayan, i am facing the same problem, i have ubuntu 16.04 [16:41:59] how many of you executed it without any error $ ansible all -i "localhost," -c local -m ping ? [16:42:05] praveenkumar: /me [16:42:12] chshbh: No I am still getting the error [16:42:14] SRvSaha, sudo systemctl start sshd.service || sudo service ssh start [16:42:15] me [16:42:31] me [16:42:32] praveenkumar, me :D [16:42:38] worked for me [16:42:49] me [16:42:54] executed [16:42:55] ping worked. [16:43:02] me [16:43:08] ping worked. [16:43:16] Folks who are having ssh issue please take help to google (make sure you mention what distro you are using) but right now let's play with ansible. [16:43:25] s/to/from/ [16:43:50] praveenkumar: Is this the output we are supposed to get : localhost | SUCCESS => { [16:43:50] "changed": false, [16:43:50] "ping": "pong" [16:43:50] } [16:43:50] ? [16:44:14] SRvSaha: yes and if you have multiple line output always use pastebin [16:44:28] SRvSaha: don't spam the channel, use pastebin [16:44:30] yes ping worked [16:44:50] I got the exact same thing SRvSaha, praveenkumar, is it ok? [16:45:18] praveenkumar: Sorry, will take care from next time [16:45:37] So ansible by default use ssh to send any instructions. [16:46:01] In this command you sent a ping to your localhost and then localhost replied back with pong. [16:46:07] rohan_h you found the solution [16:46:36] hydro, googling :( [16:46:38] here you can see 'changed' flag also in output. which mean no config change happen when you executed this step. [16:46:49] that's why it says false. [16:47:09] I am not able to get anything after installing ansible [16:47:19] Can anyone help [16:48:03] deep123k, you are not alone in that track. try Google [16:48:36] Also if you noticed we used -m ping, here m => module. So we tried out it's ping module. [16:49:13] we will discuss about module later but before that try out $ ansible all -i "localhost," -c local -m shell -a 'echo $TERM' [16:50:16] localhost | SUCCESS | rc=0 >> [16:50:17] praveenkumar: It shows us our $TERM variable content, is it the $TERM of our machine or the $TERM of a virtual machine? [16:50:18] xterm-256color [16:50:33] xterm-256color [16:51:02] http://pastebin.com/zHQ8ujrL [16:51:29] screen-256color [16:51:43] vharsh: currently we are doing on localhost so your host term not VM [16:51:50] done [16:51:54] ok [16:52:12] Anyone face issue with this? [16:52:30] no [16:52:32] no [16:52:56] no [16:53:02] no [16:53:12] http://pastebin.com/hbvy9ZyG [16:53:13] no [16:53:21] no [16:53:41] nope [16:53:45] no [16:53:52] no. but can you please explain what we did? praveenkumar [16:54:29] yes so here we used shell module '-m shell' and then executed 'echo $TERM' on your localhost. [16:55:04] what is -c local in command [16:55:40] radhikaa: that's mean we are executing those locally not any remove VM/server. [16:56:17] Now because we all are lazy so we don't want to add -i "localhost" -c local right [16:56:31] what is $TERM? [16:57:29] avik: TERM is a environment variable in your local system (check printenv) [16:57:55] Now everyone create a directory name as demo (# mkdir demo) [16:57:58] oo ok. thanks [16:58:22] then go inside that directory and then create a file hosts [16:58:36] s/file hosts/file name as hosts/ [16:59:10] Content of that file should be localhost ansible_connection=local [17:00:08] Done? [17:00:11] yes [17:00:12] yes [17:00:13] yes [17:00:14] Yes [17:00:21] yes [17:00:21] yes [17:00:28] yes [17:00:30] yes [17:00:45] done [17:00:57] yes [17:00:58] yup [17:01:05] yes [17:01:06] Alright now again try to execute ansible all -i hosts -m ping [17:01:12] yes [17:01:18] yes [17:01:27] Works the same :) [17:01:29] if you didn't get any error that means you did it right. [17:01:43] yes it should works as before. [17:02:06] yes it works [17:02:11] yes, it worked the same [17:02:28] yes done. [17:02:31] but it requires me to be in the same directory [17:02:34] yes done [17:03:00] File we just created is call inventory file in ansible term. Default inventory file present /etc/ansible/hosts and we can use -i flag to use our own inventory file. [17:03:08] praveenkumar: Works only if we are in demo directory [17:03:23] What is inventory ? [17:03:41] SRvSaha: yes other wise you have to provide abosute path to host file. [17:04:04] praveenkumar: OK thanks [17:04:08] if we are outside the the directory, then we have to give the the path of the file [17:04:25] abstatic: it just a file which have details about our servers (right now localhost) [17:04:39] praveenkumar, okay [17:05:05] Everyone open /etc/ansible/hosts file (in fedora this is location I am not sure what is location for other distro) [17:05:24] It is the same for Arch Linux. [17:05:29] Try to read it and let me know if something doesn't make sense to you. [17:06:35] Groups of hosts are delimited by [header] elements [17:06:36] ? [17:07:16] Can't find it. [17:07:37] LambaInsaan, +1 [17:07:55] how example 1 and 2 are different ? [17:08:04] praveenkumar, not found. [fedora 24] [17:08:20] can't find it [ubuntu 14.04] [17:08:32] hydro: example one is ungrouped host and 2 is group host. [17:08:40] hydro: I will explain it in a bit. [17:08:44] ok [17:09:16] avik: that's not posible? How did you install it? (using dnf or some other way)? [17:09:30] ! [17:09:41] Can any ubuntu user help abstatic [17:09:44] next [17:09:45] praveenkumar, i ma using this http://docs.ansible.com/ansible/intro_installation.html#running-from-source ? [17:09:48] @abstatic: it works for ubuntu 14.04 [17:09:49] next [17:09:55] next [17:09:57] exnt [17:09:59] next [17:10:00] just wrote anisble. It prompted me to install or not [17:10:04] praveenkumar, do i need to install it using apt as well ? [17:10:07] praveenkumar, ^^ [17:10:08] Works in Ubuntu 16.04 LTS [17:10:31] Got it working [17:10:44] @abstatic i could easily find hosts file in /etc/ansible/ [17:10:51] in ubuntu 14.04 [17:11:15] radhikaa, I was running it directly from source. After installing it using apt I found it as well :D [17:11:18] abstatic: I am not sure but folks who are not able to find then => https://paste.fedoraproject.org/406251/28265147/ [17:11:28] next [17:11:31] does www[001:006].example.com mean that there are 6 hosts? numbered from 1 to 6? [17:11:42] praveenkumar, strangely enough, ls in ansible dir. shows hosts [17:11:54] praveenkumar: i think they have to do cd /etc/ansible/ and than type cat hosts to see the content [17:11:56] @abstatic. ok.:) [17:12:44] code_geek: yes right [17:13:03] ok [17:13:08] ok, got it, doing vi [17:13:11] praveenkumar, what are groups here ? [17:13:26] lets now discuss about groups and un-group stuff. [17:14:18] can I know what all have been discussed till now, as I got disconnected ? [17:14:47] so assume I have 20 db server and I want to install a patch to all those server or I want same config for all those server to I will create a group call [dbserver] and then list down hostname/IP for those. [17:15:24] pabitra: https://da.gd/GdwCN [17:15:24] then I will just say ansible dbserver -m ping (which will only ping my db servers not any other group) [17:15:43] Same way I can have frontend group also [17:15:49] Trhanks alot sandeepkk :) [17:16:26] Good thing about grouping is it will make things clean and easy to identify. [17:17:34] [WARNING]: provided hosts list is empty, only localhost is available [17:17:56] on running ansible dbserver -m ping [17:17:56] Now try to do one thing in your host file where you added localhost before that put [webserver] [17:18:17] hydro: because you don't have any dbserver group yet. [17:18:23] with the []? [17:18:27] yes [17:18:38] ok thanks [17:18:50] now when you done try to execute $ ansible webserver -i hosts -m ping [17:19:29] Now try to do one thing in your host file where you added localhost before that put [webserver] ? what are you trying to say [17:19:34] So instead of "all" which mean (group + non-group) we used a specific group. [17:19:46] hydro: we are putting our localhost under a group [17:20:17] hydro: currently it is a stand alone host (Ungrouped host) [17:20:52] Everyone got that? [17:21:00] yes [17:21:12] yes [17:21:17] yes :) [17:21:30] yes [17:21:54] yes [17:22:04] [WARNING]: provided hosts list is empty, only localhost is available [17:22:08] yes, finally :) [17:22:28] Great so we discussed about inventory and ad-hoc run. Next session we will discuss about playbook and then tell you how we can create a playbook with different task and execute. [17:22:52] praveenkumar: what has to be done in the hosts file? [17:22:56] praveenkumar, is it ok t get what hydro just showed ^^? [17:22:57] Also we will write playbook for all step which we listed today in the begin of this session. [17:23:24] *t/to [17:24:03] avik: hydro http://paste.fedoraproject.org/406261/9290171/ this is what you folks should get. [17:24:13] praveenkumar, I goe an error http://paste.fedoraproject.org/406262/92901814/ [17:24:47] praveenkumar, what is the tool you use to install and set-up an OS on a bare-metal, before all the ansible stuff can be done. [17:24:54] As a homework you folks check http://docs.ansible.com/ansible/playbooks_intro.html and whatever interest you (ansible have huge documentation) [17:25:01] nevermind.i got it [17:25:45] gobinda: because you put [webserver] and localhost in same line put it in the different line [17:25:51] I have played around with playbooks. :) More specifically, LAMP setup. [17:26:37] done [17:26:49] praveenkumar, it done thank you [17:27:03] mbtamuli12_: baremetal provision is something different and when you have bare minimal OS up you can use ansible to do all sort of stuff. [17:27:25] Anyone have any more questions? [17:28:29] Alright so I am going to close this session [17:28:33] Roll call please [17:28:36] Mahendra Yadav [17:28:45] Aman Kumar [17:28:46] shweta suman [17:28:47] Mriyam Tamuli [17:28:49] Alekhya [17:28:49] Mahesh [17:28:51] Aniket Khisti [17:28:53] Deepanshu kapoor [17:28:54] sandeep kumar choudhary [17:28:55] Shantanu Acharya [17:28:55] Akash Mishra [17:28:56] shobhit upadhyay [17:28:57] Rhitik Bhatt [17:29:04] Anupama Mandal [17:29:11] Gobinda Akhuli [17:29:14] Sudeep Mukherjee [17:29:16] Avinash Madhukar [17:29:20] #endclass [17:29:20] [## Class Ended at Thu Aug 11 17:29:20 2016 ##]