Ansible分离部署LAMP架构

Now try logging into the machine, with: “ssh ‘root@192.168.129.133’”

and check to make sure that only the key(s) you wanted were added.

[root@master ~]# ssh-agent bash

[root@master ~]# ssh-add

Enter passphrase for /root/.ssh/id_rsa:

Identity added: /root/.ssh/id_rsa (root@master)

192.168.129.133安装httpd


[root@master ~]# ansible httpd -m yum -a ‘name=httpd* state=installed’

192.168.129.133 | CHANGED => {

“ansible_facts”: {

“discovered_interpreter_python”: “/usr/libexec/platform-python”

},

“changed”: true,

“msg”: “”,

“rc”: 0,

“results”: [

“Installed: mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64”,

“Installed: cyrus-sasl-devel-2.1.27-1.el8.x86_64”,

“Installed: expat-devel-2.2.5-3.el8.x86_64”,

“Installed: apr-1.6.3-11.el8.x86_64”,

“Installed: apr-devel-1.6.3-11.el8.x86_64”,

“Installed: libdb-devel-5.3.28-40.el8.x86_64”,

“Installed: apr-util-1.6.1-6.el8.x86_64”,

“Installed: httpd-tools-2.4.37-39.module_el8.4.0+778+c970deab.x86_64”,

“Installed: apr-util-bdb-1.6.1-6.el8.x86_64”,

“Installed: openldap-devel-2.4.46-11.el8.x86_64”,

“Installed: apr-util-devel-1.6.1-6.el8.x86_64”,

“Installed: httpd-2.4.37-39.module_el8.4.0+778+c970deab.x86_64”,

“Installed: apr-util-openssl-1.6.1-6.el8.x86_64”,

“Installed: centos-logos-httpd-85.8-1.el8.noarch”,

“Installed: httpd-devel-2.4.37-39.module_el8.4.0+778+c970deab.x86_64”,

“Installed: httpd-filesystem-2.4.37-39.module_el8.4.0+778+c970deab.noarch”,

“Installed: httpd-manual-2.4.37-39.module_el8.4.0+778+c970deab.noarch”

]

}

//开启服务与开机自启

[root@master ~]# ansible httpd -m service -a “name=httpd state=started enabled=yes”

192.168.129.133 | SUCCESS => {

“ansible_facts”: {

“discovered_interpreter_python”: “/usr/libexec/platform-python”

},

“changed”: false,

“enabled”: true,

“name”: “httpd”,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值