add lines to playbook.yml
- name: install mysql
apt:
name: mysql-server
state: present
[root@vagrant ~]# vagrant provision
==> default: Running provisioner: ansible...
default: Running ansible-playbook...
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [default]
TASK [Update and upgrade apt packages] *****************************************
changed: [default]
[WARNING]: The value True (type bool) in a string field was converted to
'True' (type string). If this does not look like what you expect, quote the
entire value to ensure it does not change.
[WARNING]: Could not find aptitude. Using apt-get instead
TASK [install JDK 11] **********************************************************
ok: [default]
TASK [install apache2] *********************************************************
ok: [default]
TASK [install tomcat] **********************************************************
ok: [default]
TASK [install zabbix] **********************************************************
ok: [default]
TASK [install mysql] ***********************************************************
changed: [default]
PLAY RECAP *********************************************************************
default : ok=7 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@vagrant ~]#
- name: install mysql
apt:
name: mysql-server
state: present
[root@vagrant ~]# vagrant provision
==> default: Running provisioner: ansible...
default: Running ansible-playbook...
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [default]
TASK [Update and upgrade apt packages] *****************************************
changed: [default]
[WARNING]: The value True (type bool) in a string field was converted to
'True' (type string). If this does not look like what you expect, quote the
entire value to ensure it does not change.
[WARNING]: Could not find aptitude. Using apt-get instead
TASK [install JDK 11] **********************************************************
ok: [default]
TASK [install apache2] *********************************************************
ok: [default]
TASK [install tomcat] **********************************************************
ok: [default]
TASK [install zabbix] **********************************************************
ok: [default]
TASK [install mysql] ***********************************************************
changed: [default]
PLAY RECAP *********************************************************************
default : ok=7 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@vagrant ~]#
[root@vagrant ~]# vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Mon Aug 26 16:12:34 UTC 2019
System load: 0.1 Processes: 105
Usage of /: 22.7% of 9.63GB Users logged in: 0
Memory usage: 42% IP address for enp0s3: 10.0.2.15
Swap usage: 0%
* Keen to learn Istio? It's included in the single-package MicroK8s.
https://snapcraft.io/microk8s
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
0 packages can be updated.
0 updates are security updates.
Last login: Mon Aug 26 16:02:54 2019 from 10.0.2.2
vagrant@ubuntu-bionic:~$ apt list --installed | grep mysql
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
mysql-client-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-client-core-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-common/bionic,now 5.8+1.0.4 all [installed,automatic]
mysql-server/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 all [installed]
mysql-server-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-server-core-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
vagrant@ubuntu-bionic:~$
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Mon Aug 26 16:12:34 UTC 2019
System load: 0.1 Processes: 105
Usage of /: 22.7% of 9.63GB Users logged in: 0
Memory usage: 42% IP address for enp0s3: 10.0.2.15
Swap usage: 0%
* Keen to learn Istio? It's included in the single-package MicroK8s.
https://snapcraft.io/microk8s
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
0 packages can be updated.
0 updates are security updates.
Last login: Mon Aug 26 16:02:54 2019 from 10.0.2.2
vagrant@ubuntu-bionic:~$ apt list --installed | grep mysql
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
mysql-client-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-client-core-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-common/bionic,now 5.8+1.0.4 all [installed,automatic]
mysql-server/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 all [installed]
mysql-server-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
mysql-server-core-5.7/bionic-updates,bionic-security,now 5.7.27-0ubuntu0.18.04.1 amd64 [installed,automatic]
vagrant@ubuntu-bionic:~$
Comments
Post a Comment