用ansible修改用户密码并给予挂载点
--- - hosts: myjob gather_facts: false tasks: - name: chage user passwd user: name={{ item.name }} password={{ item.chpass | password_hash('sha512') }} update_password=always with_items: - { name: 'monitor', chpass: 'jialy' } - name: create a logical volume of 50g. lvol: vg: vgroot lv: lv_monitor size: 50g - name: create a xfs filesystem on /dev/mapper/vgroot-lv_monitor filesystem: fstype: xfs dev: /dev/mapper/vgroot-lv_monitor - name: mount up mount: path: /monitor src: /dev/mapper/vgroot-lv_monitor fstype: xfs state: mounted - name: change ownership of a directory file: path: /monitor state: directory recurse: yes owner: monitor group: monitor
job.yml文件内容如上。