博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统
阅读量:6709 次
发布时间:2019-06-25

本文共 1983 字,大约阅读时间需要 6 分钟。

总结构

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

1

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- include: group.yml- include: user.yml- include: mkdir.yml- include: data.yml- include: link.yml- include: linkstate.yml- include: conf.yml- include: server.yml

2

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: create group  group: name=mysql system=yes gid=306

3

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: create user  user: name=mysql system=yes uid=306 group=306 home=/data/mysql

4

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: mkdir  file: name=/data/mysql owner=root group=mysql state=directory

5

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: copy data  unarchive: src=mariadb-10.2.23-linux-x86_64.tar.gz  dest=/usr/local

6

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: link  file: src=/usr/local/mariadb-10.2.23-linux-x86_64 dest=/usr/local/mysql state=link

7

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: link state  file: name=/usr/local/mysql owner=root group=mysql

8

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: mkdir conf   file: path=/etc/mysql state=directory- name: copy conf  template: src=my-large.cnf.j2 dest=/etc/mysql/my.cnf

9

实例ansible-role :通过role进行二进制批量部署mariadb从而批量上线sql系统

- name: install  shell: /usr/local/mysql/scripts/mysql_install_db --datadir=/data/mysql --user=mysql- name: copy service conf  template: src=mysql.server.j2 dest=/etc/rc.d/init.d/mysqld- name: add service  shell: chkconfig --add mysqld- name: chmod  shell: chmod +x /etc/init.d/mysqld- name: start server  shell: service mysqld start- name: PATH  shell: echo PATH=/usr/local/mysql/bin:$PATH > /etc/profile.d/mysql- name: source  shell: source /etc/profile.d/mysql

10 安全初始化

#!/usr/bin/expectset timeout 60#set password [lindex $argv 0]spawn mysql_secure_installationexpect {        "enter for none" { send "\r"; exp_continue}        "Change the root password" { send "\r"; exp_continue}        "New password" { send "new passwd\r"; exp_continue}        "Re-enter new password" { send "newpasswd\r"; exp_continue}        "Remove anonymous users" { send "\r"; exp_continue}        "Disallow root login remotely" { send "n\r"; exp_continue}        "Remove test database and access to it" { send "\r"; exp_continue}        "Reload privilege tables now" { send "\r"; exp_continue}        "Cleaning up" { send "\r"}}interact ' > mysql_secure_installation.exp

转载于:https://blog.51cto.com/9019400/2385735

你可能感兴趣的文章
关于索引
查看>>
让pandoc输出pdf时支持中文
查看>>
利用反射实现页面控件与实体之间的绑定
查看>>
Xamarin-Android_BaseAdapter 简单的复用
查看>>
快速傅里叶变换(FFT)
查看>>
在C#程序中使用ocx的方法
查看>>
C# 递归查找文件夹下所有文件和子文件夹的所有文件
查看>>
如何发布你的 Maya 应用到欧特克官方的 Exchange Store
查看>>
react之自定义react-redux的provider、connect
查看>>
JQuery中工厂函数$()初探
查看>>
网上发现的一个android UI包
查看>>
新闻源图片放到js里
查看>>
SpringBoot学习:整合Mybatis,使用HikariCP超高性能数据源
查看>>
Java--面向对象
查看>>
微信模板消息群发系统
查看>>
高内聚低耦合
查看>>
2012 chengdu现场赛 Browsing History HDU4464(简单字符串)
查看>>
Codeforces Round #239 (Div. 1) 解题报告
查看>>
R与JAVA的混合编程
查看>>
hibernate工作流程、session
查看>>