ansible vagrant shell commands httpd install

vagrantfile

config.vm.provision "shell", inline: <<-SHELL
sudo yum install httpd -y
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
SHELL
end
end


[root@localhost ~]# vagrant provision
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: Running provisioner: ansible...
Vagrant has automatically selected the compatibility mode '2.0'
according to the Ansible version installed (2.8.4).

Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode

==> default: Running provisioner: shell...
    default: Running: inline script
    default: Loaded plugins: fastestmirror
    default: Loading mirror speeds from cached hostfile
    default:  * base: centos.excellmedia.net
    default:  * epel: repos.del.extreme-ix.org
    default:  * extras: centos.excellmedia.net
    default:  * updates: centos.excellmedia.net
    default: Resolving Dependencies
    default: --> Running transaction check
    default: ---> Package httpd.x86_64 0:2.4.6-89.el7.centos.1 will be installed
    default: --> Processing Dependency: httpd-tools = 2.4.6-89.el7.centos.1 for package: httpd-2.4.6-89.el7.centos.1.x86_64
    default: --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-89.el7.centos.1.x86_64
    default: --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-89.el7.centos.1.x86_64
    default: --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-89.el7.centos.1.x86_64
    default: --> Running transaction check
    default: ---> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
    default: ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
    default: ---> Package httpd-tools.x86_64 0:2.4.6-89.el7.centos.1 will be installed
    default: ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
    default: --> Finished Dependency Resolution
    default:
    default: Dependencies Resolved
    default:
    default: ================================================================================
    default:  Package           Arch         Version                     Repository     Size
    default: ================================================================================
    default: Installing:
    default:  httpd             x86_64       2.4.6-89.el7.centos.1       updates       2.7 M
    default: Installing for dependencies:
    default:  apr               x86_64       1.4.8-3.el7_4.1             base          103 k
    default:  apr-util          x86_64       1.5.2-6.el7                 base           92 k
    default:  httpd-tools       x86_64       2.4.6-89.el7.centos.1       updates        91 k
    default:  mailcap           noarch       2.1.41-2.el7                base           31 k
    default:
    default: Transaction Summary
    default: ================================================================================
    default: Install  1 Package (+4 Dependent packages)
    default:
    default: Total download size: 3.0 M
    default: Installed size: 10 M
    default: Downloading packages:
    default: --------------------------------------------------------------------------------
    default: Total                                              515 kB/s | 3.0 MB  00:06   
    default: Running transaction check
    default: Running transaction test
    default: Transaction test succeeded
    default: Running transaction
    default:   Installing : apr-1.4.8-3.el7_4.1.x86_64                                   1/5
    default:
    default:   Installing : apr-util-1.5.2-6.el7.x86_64                                  2/5
    default:
    default:   Installing : httpd-tools-2.4.6-89.el7.centos.1.x86_64                     3/5
    default:
    default:   Installing : mailcap-2.1.41-2.el7.noarch                                  4/5
    default:
    default:   Installing : httpd-2.4.6-89.el7.centos.1.x86_64                           5/5
    default:
    default:   Verifying  : httpd-2.4.6-89.el7.centos.1.x86_64                           1/5
    default:
    default:   Verifying  : mailcap-2.1.41-2.el7.noarch                                  2/5
    default:
    default:   Verifying  : httpd-tools-2.4.6-89.el7.centos.1.x86_64                     3/5
    default:
    default:   Verifying  : apr-util-1.5.2-6.el7.x86_64                                  4/5
    default:
    default:   Verifying  : apr-1.4.8-3.el7_4.1.x86_64                                   5/5
    default:
    default:
    default: Installed:
    default:   httpd.x86_64 0:2.4.6-89.el7.centos.1                                       
    default:
    default: Dependency Installed:
    default:   apr.x86_64 0:1.4.8-3.el7_4.1                  apr-util.x86_64 0:1.5.2-6.el7 
    default:   httpd-tools.x86_64 0:2.4.6-89.el7.centos.1    mailcap.noarch 0:2.1.41-2.el7 
    default: Complete!
vagrant@centos7 ~]$ sudo service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-09-04 06:54:36 UTC; 3h 13min ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 1926 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─1926 /usr/sbin/httpd -DFOREGROUND
           ├─1928 /usr/sbin/httpd -DFOREGROUND
           ├─1929 /usr/sbin/httpd -DFOREGROUND
           ├─1930 /usr/sbin/httpd -DFOREGROUND
           ├─1931 /usr/sbin/httpd -DFOREGROUND
           └─1932 /usr/sbin/httpd -DFOREGROUND

Sep 04 06:54:36 centos7.localdomain systemd[1]: Starting The Apache HTTP Server...
Sep 04 06:54:36 centos7.localdomain httpd[1926]: AH00558: httpd: Could not reliably...e
Sep 04 06:54:36 centos7.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

Comments