12周作业

1、通过ansible Roles编排实现 httpd 角色的部署
创建目录
mkdir -pv /data/roles/httpd/{default,files,handlers,meta,tasks,templates,vars}
创建tasks下相关文件
vim main.yml
- include: groupadd.yml
- include: useradd.yml
- include: install.yml
- include: config.yml
- include: index.yml
- include: service.yml

vim groupadd.yml
- name: groupadd
group: name=apache system=yes gid=80

vim useradd.yml
- name: useradd
user: name=apache system=yes shell=/sbin/nologin home=/var/www/ uid=80 group=apache

vim install.yml
- name: install httpd
yum: name=httpd

vim config.yml
- name: config file
copy: src=/data/roles/httpd/files/httpd.conf dest=/etc/httpd/conf/
notify: restart

vim index.yml
- name: index.html
copy: src=index.html dest=/var/www/html/

vim service.yml
- name: service
service: name=httpd state=started enabled=yes

创建handlers下相关文件
vim main.yml
- name: restart
service: name=httpd state=restarted

files文件下准备好相关文件
httpd.conf index.html

在playbook中调用角色
vim https_role.yml
---
- hosts: web
remote_user: root

roles:
- httpd


2、简述 MySQL 数据库访问的执行过程。

3、S E L E C T 语句的完整语法较复杂,但至少包括的部分是 ( A)
A.仅 S E L E C T
B.S E L E C T ,F R O M
C.S E L E C T ,G R O U P
D.S E L E C T ,I N T O


4、一张表的主键个数为 (C )


A.至多 3 个 B.没有限制
C.至多 1 个 D.至多 2 个

原文地址:https://www.cnblogs.com/blchangkong/p/13606194.html