当前位置: 首页 > news >正文

网站定制与模板开发wordpress主题akina

网站定制与模板开发,wordpress主题akina,莱芜seo推广,网络营销推广组合写在前面 考试顺便整理博文内容整理 使用 Ansible 部署 samba 客户端和服务端理解不足小伙伴帮忙指正 对每个人而言#xff0c;真正的职责只有一个#xff1a;找到自我。然后在心中坚守其一生#xff0c;全心全意#xff0c;永不停息。所有其它的路都是不完整的#xff0c…写在前面 考试顺便整理博文内容整理 使用 Ansible 部署 samba 客户端和服务端理解不足小伙伴帮忙指正 对每个人而言真正的职责只有一个找到自我。然后在心中坚守其一生全心全意永不停息。所有其它的路都是不完整的是人的逃避方式是对大众理想的懦弱回归是随波逐流是对内心的恐惧 ——赫尔曼·黑塞《德米安》 涉及到的文件 [studentworkstation filestorage-automation]$ tree . . ├── ansible.cfg ├── inventory ├── smb_client.yml ├── smb_server.yml ├── smb_vars.yml └── templates└── smb.conf.j2[studentworkstation filestorage-automation]$涉及到的 主机清单 [studentworkstation filestorage-automation]$ cat inventory [servers] serverd.lab.example.com[clients] servera.lab.example.com serverb.lab.example.com serverc.lab.example.com [studentworkstation filestorage-automation]$这里我们使用 serverd 做服务端使用 servera,b,c 做客户端 [studentworkstation filestorage-review]$ cat ansible.cfg [defaults] inventoryinventory remote_userdevopsansible 配置文件 使用 devops 作ssh 用户 samba 对应的配置文件的 jija 模版 [studentworkstation filestorage-automation]$ cat templates/smb.conf.j2 [global]workgroup SAMBAsecurity userpassdb backend tdbsamsmb encrypt requiredserver min protocol SMB3[{{ share_name }}]path {{ shared_dir }}write list {{ allowed_group }} [studentworkstation filestorage-automation]$通过模版配置文件我们可以看到使用的是最基本的配置文件下面为涉及到的变量 [studentworkstation filestorage-review]$ cat smb_vars.yml --- shared_dir: /srv/developers share_name: devdata mount_point: /devs_data# User account for mounting the share samba_usermount: sambamount samba_passmount: redhatallowed_group: developers [studentworkstation filestorage-review]$服务端部署 服务端需要执行的剧本 安装Samba软件包使用yum模块安装Samba软件包。创建Linux和Samba用户创建一个用于挂载共享的Linux和Samba用户。创建Linux组创建一个用于具有写访问权限的用户组。创建Samba用户为Samba用户创建密码并将其添加到Samba用户数据库中。创建目录使用file模块创建要共享的目录并设置所有者、组和权限。配置Samba使用template模块将SMB配置文件模板复制到目标位置。启动SMB服务使用service模块启动和启用SMB服务。开放Samba防火墙服务使用firewalld模块开启Samba防火墙服务。定义处理程序定义名为 reload smb 的处理程序用于在配置更改后重新加载SMB服务。 [studentworkstation filestorage-automation]$ cat smb_server.yml --- - name: Share a directory with SMBhosts: serverd.lab.example.combecome: truevars_files:- smb_vars.ymltasks:- name: the samba package is installedyum:name: sambastate: present# Creating the Linux and Samba user for the multiuser mount.# That user is only used to mount the share.- name: the Linux user for Samba mount existsuser:name: {{ samba_usermount }}shell: /sbin/nologincreate_home: nosystem: yes- name: the Samba user for Samba mount existscommand: smbpasswd -s -a {{ samba_usermount }}args:stdin: {{ samba_passmount }}\n{{ samba_passmount }}# Group and users with write access to the share- name: the Linux group existsgroup:name: {{ allowed_group }}system: yes- name: the Linux users exist for Samba usersuser:name: {{ item[name] }}shell: /sbin/nologingroups:- {{ allowed_group }}loop: {{ samba_users }}no_log: true- name: the Samba users existcommand: smbpasswd -s -a {{ item[name] }}args:stdin: {{ item[password] }}\n{{ item[password] }}loop: {{ samba_users }}no_log: true- name: the directory existsfile:path: {{ shared_dir }}owner: rootgroup: {{ allowed_group }}mode: 2775state: directorysetype: samba_share_t- name: the directory is sharedtemplate:src: templates/smb.conf.j2dest: /etc/samba/smb.confowner: rootgroup: rootmode: 0644setype: samba_etc_tnotify: reload smb- name: the smb service is started and enabledservice:name: smbstate: startedenabled: yes- name: the samba firewall service is openedfirewalld:service: sambastate: enabledimmediate: yespermanent: yeshandlers:- name: reload smbservice:name: smbstate: reloaded [studentworkstation filestorage-automation]$客户端配置 安装 cifs-utils 软件包使用yum模块确保目标主机上安装了cifs-utils软件包。创建凭据文件使用copy模块创建一个凭据文件/etc/samba/creds.txt其中包含SMB用户名和密码。用户名和密码从samba_usermount和samba_passmount变量中获取。挂载SMB共享使用mount模块挂载SMB共享。path参数指定本地系统上的挂载点src参数指定SMB共享的位置//serverd.lab.example.com/{{ share_name }}。opts参数指定挂载选项包括凭据文件路径/etc/samba/creds.txt、multiuser模式和seal安全选项。fstype参数将文件系统类型指定为cifs。创建Linux用户使用user模块在目标主机上创建Linux用户。用户名和密码从samba_users变量中获取。密码使用SHA-512算法以’redhatsalt’作为盐值进行哈希处理。 [studentworkstation filestorage-automation]$ cat smb_client.yml --- - name: Access an SMB sharehosts: servera.lab.example.combecome: truevars_files:- smb_vars.ymltasks:- name: the cifs-utils package is installedyum:name: cifs-utilsstate: present- name: the credential file existscopy:content: username{{ samba_usermount }}\n\password{{ samba_passmount }}\ndest: /etc/samba/creds.txtowner: rootgroup: rootmode: 0600no_log: true- name: the SMB share is mountedmount:path: {{ mount_point }}src: //serverd.lab.example.com/{{ share_name }}opts: credentials/etc/samba/creds.txt,multiuser,sealstate: mountedfstype: cifs- name: the Linux users existuser:name: {{ item.name }}shell: /bin/bashpassword: {{ item.password | \password_hash(sha512, redhatsalt) }}loop: {{ samba_users }}no_log: true [studentworkstation filestorage-automation]$博文部分内容参考 © 文中涉及参考链接内容版权归原作者所有如有侵权请告知这是一个开源项目如果你认可它不要吝啬星星哦 红帽服务管理与自动化RH358授课笔记 © 2018-2023 liruilongergmail.com, All rights reserved. 保持署名-非商用-相同方式共享(CC BY-NC-SA 4.0)
http://www.sadfv.cn/news/13011/

相关文章:

  • 聊城高端网站制作南宁自助建站模板下载
  • nas可以做网站服务器吗大商创源码
  • 网站推广计划方案网站建设与管理需要什么软件有哪些方面
  • 南昌网站建设怎么样网站有订单了有声音提醒怎么做
  • 深圳优秀网站建设定制ip域名查询地址
  • 墨客网站建设xcyxqc根据颜色找网站
  • 校园网站建设年度总结营销网站制作多少钱
  • 做网站的人怎么联系微信网站设计制作
  • 泉州哪里做网站网站网站建设专业
  • 网站开发公司怎么查网站建设公司做前端
  • 外贸电商网站制作有域名可以自己做网站吗
  • 用vultr做网站做试管网站
  • 专业网站建设必要性谁可以做开码网站
  • 沙县住房和城乡规划建设局网站网站建设 话术
  • 荆州建设局网站网站域名实名制
  • 做黏土的网站国外虚拟物品交易网站
  • 外卖网站那家做的好西安网站seo技术厂家
  • 网站怎样做域名绑定968深圳网站建设公司
  • 网站版面设计宁海建设局网站
  • 外贸网站品牌官网建设重庆公司章程在哪里打印
  • 广州的兼职网站建设网站维护内容及费用
  • 网站建设与制作实训报告国外的响应式网站模板
  • 合肥网站建设网新学校网站建设主体
  • 重庆seo整站优化科技公司经营范围包括哪些
  • 去什么网站可以做ctf的题目2021跨境电商最火的产品
  • 服务号微网站怎么做的动漫网站建设
  • 学做软件的网站有哪些内容网站单页模板制作软件
  • 青岛建设银行股份有限公司网站首页企炬网站
  • 网站空间哪里买东莞人才招聘网最新招聘信息
  • 建设一个电商网站的流程图wordpress导入商品