随笔分类 -  Ansible

摘要:- hosts: database remote_user: root gather_facts: true tasks: - name: pp shell: | echo aaaaa ech bbbb ignore_errors: true - debug: msg="{{ ansible_dis 阅读全文
posted @ 2022-02-13 16:05 ascertain 阅读(60) 评论(0) 推荐(0) 编辑
摘要:- name: stat hosts: all tasks: - name: Checking File Existence stat: path: "/etc/hosts" register: existence - name: Debug File Existence debug: var: e 阅读全文
posted @ 2022-01-11 13:44 ascertain 阅读(176) 评论(0) 推荐(0) 编辑
摘要:fail & failed_when: - hosts: buster remote_user: root tasks: - shell: "echo 'This is a string for testing--error'" register: value - debug: msg: "2" # 阅读全文
posted @ 2021-12-17 15:24 ascertain 阅读(157) 评论(0) 推荐(0) 编辑
摘要:state : absent, directory, file, hard, link, touch Change File Attributes ansible all -m file -a 'path=/root/bb owner=laconic group=laconic mode=7777' 阅读全文
posted @ 2021-12-03 16:22 ascertain 阅读(92) 评论(0) 推荐(0) 编辑
摘要:- hosts: gale remote_user: root gather_facts: no name: copy files tasks: - name: copy files copy: src: "{{ item.src }}" dest: "{{ item.dest }}" with_i 阅读全文
posted @ 2021-08-19 17:47 ascertain 阅读(43) 评论(0) 推荐(0) 编辑
摘要:- hosts: gale remote_user: root gather_facts: no tasks: - name: get path command: |+ pwd register: result - name: get debug result debug: var=result v 阅读全文
posted @ 2021-08-02 17:57 ascertain 阅读(1035) 评论(0) 推荐(0) 编辑
摘要:install mysql - hosts: gale remote_user: root gather_facts: no tasks: - name: install packages yum: name=libaio,perl - {name: create group, group: nam 阅读全文
posted @ 2021-07-31 20:52 ascertain 阅读(54) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示