随笔分类 - ansible
摘要:安装包下载地址:https://releases.ansible.com/ansible/ 注意:ansible对python版本有要求 1、安装依赖 yum -y install python-jinja2 PyYAML python-paramiko python-babel python-cr
阅读全文
摘要:1、编辑配置文件 /etc/ansible/hosts [web] #ansible默认选择root用户,普通用户使用需要指定用户名和密码 192.168.56.101 ansible_user=普通用户名 ansible_ssh_pass=密码 192.168.56.102 ansible_use
阅读全文
摘要:上传安装文件到ansible 端的/data/zabbix目录下 1、解压安装文件中的zabbix_agentd.conf到/data/zabbix目录下 tar -zxvf zabbix_agent-6.0.6-linux-3.0-amd64-static.tar.gz ./conf/zabbix
阅读全文
摘要:首先,上传文件docker-20.10.9.tgz 到/data/docker/下 1、编辑docker.service文件 docker的配置文件 vim /data/docker/docker.service 【 [Unit]Description=Docker Application Cont
阅读全文
摘要:首先,上传 mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz 到/data/mysql/ 下 1、编辑mysql.sh脚本 vim /data/mysql/mysql.sql 【 #/bin/bash#脚本安装 mysql,上传安装包至 /rootcd /root
阅读全文
摘要:添加 1、编辑文件hosts.tml vim hosts.tml 【 hosts: 192.168.59.103 remote_user: root tasks: - name: add hosts lineinfile: name=/etc/hosts line="192.168.59.103 w
阅读全文
摘要:1、上传文件到ansible端上 /data/jdk/jdk-8u341-linux-x64.tar.gz(下载地址:) 2、编辑jdk.yml文件 vim jdk.yml 【 hosts: 192.168.59.103 remote_user: root tasks: - name: mkdir
阅读全文
摘要:1、编辑配置文件 先写一点,方便后期修改配置 vim /root/mongod.conf 【 storage: dbPath: /data/db 】 2、编辑docker-mongodb.yml 【 hosts: 192.168.59.103 remote_user: root tasks: - n
阅读全文
摘要:1、准备安装包 nginx-1.22.0.tar.gz(地址:https://nginx.org/download/) 上传到 /data/nginx 下 2、编写剧本 vim nginx.yml 【 hosts: 192.168.59.103 remote_user: root tasks: -
阅读全文
摘要:1、编辑redis.conf配置文件 为了后期修改配置,先写一个配置。后期一般要修改配置的,建议先写一个 【 #库的数量,默认是16 databases 32 】 2、编辑剧本 vim redis.yml 【 #第一行给 #主机- hosts: 192.168.59.103 #用户 remote_u
阅读全文
摘要:ansible 基于ssh 主要组成部分 安装 yum安装需要先安装epel源:yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum -y install python-ji
阅读全文