ansible角色


在RHCE环境中完成以下题目

1、使用RHEL系统角色

安装 RHEL 系统角色软件包,并创建符合以下条件的playbook /home/student/ansible/timesync.yml:
在所有受管节点上运行
使用 timesync 角色
配置该角色,以使用当前有效的 NTP 提供商
配置该角色,以使用时间服务器 classroom.example.com
配置该角色,以启用 iburst 参数

[student@ansible ansible]$ sudo dnf -y install rhel-system-roles-1.7.3-2.el8.noarch 
[student@ansible ansible]$ cp -r /usr/share/ansible/roles/rhel-system-roles.timesync/  /home/student/ansible/roles/timesync
[student@ansible ansible]$ vim timesync.yml 
---
- name: test
  hosts: all
  vars: 
    timesync_ntp_servers: 
      - hostname: classroom.example.com
        iburst: yes
  roles: 
    - timesync


[student@ansible ansible]$ ansible-playbook timesync.yml 

PLAY [test] ********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [node1]
ok: [node3]
ok: [node2]

TASK [timesync : Set version specific variables] *******************************
ok: [node3]
ok: [node1]
ok: [node2]

TASK [timesync : Populate service facts] ***************************************
ok: [node3]
ok: [node2]
ok: [node1]

TASK [Set variable `timesync_services` with filtered uniq service names] *******
ok: [node1]
ok: [node2]
ok: [node3]

TASK [Check that variable 'timesync_services' is defined] **********************
ok: [node1] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [node2] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [node3] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [timesync : Check if only NTP is needed] **********************************
ok: [node1]
ok: [node2]
ok: [node3]

TASK [timesync : Check if single PTP is needed] ********************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Check if both NTP and PTP are needed] *************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Determine current NTP provider] *******************************
ok: [node1]
ok: [node3]
ok: [node2]

TASK [timesync : Select NTP provider] ******************************************
ok: [node1]
ok: [node2]
ok: [node3]

TASK [timesync : Install chrony] ***********************************************
ok: [node3]
ok: [node2]
ok: [node1]

TASK [timesync : Install ntp] **************************************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Install linuxptp] *********************************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Gather package facts] *****************************************
ok: [node1]
ok: [node3]
ok: [node2]

TASK [timesync : Run phc_ctl on PTP interface] *********************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Check if PTP interface supports HW timestamping] **************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Generate chrony.conf file] ************************************
changed: [node2]
changed: [node1]
changed: [node3]

TASK [timesync : Generate chronyd sysconfig file] ******************************
changed: [node1]
changed: [node2]
changed: [node3]

TASK [timesync : Generate ntp.conf file] ***************************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Generate ntpd sysconfig file] *********************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Generate ptp4l.conf file] *************************************
skipping: [node1]
skipping: [node2]
skipping: [node3]

TASK [timesync : Generate ptp4l sysconfig file] **************
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值