随笔分类 - Ansible
摘要:- hosts: database remote_user: root gather_facts: true tasks: - name: pp shell: | echo aaaaa ech bbbb ignore_errors: true - debug: msg="{{ ansible_dis
阅读全文
摘要:- name: stat hosts: all tasks: - name: Checking File Existence stat: path: "/etc/hosts" register: existence - name: Debug File Existence debug: var: e
阅读全文
摘要:fail & failed_when: - hosts: buster remote_user: root tasks: - shell: "echo 'This is a string for testing--error'" register: value - debug: msg: "2" #
阅读全文
摘要:state : absent, directory, file, hard, link, touch Change File Attributes ansible all -m file -a 'path=/root/bb owner=laconic group=laconic mode=7777'
阅读全文
摘要:- hosts: gale remote_user: root gather_facts: no name: copy files tasks: - name: copy files copy: src: "{{ item.src }}" dest: "{{ item.dest }}" with_i
阅读全文
摘要:- hosts: gale remote_user: root gather_facts: no tasks: - name: get path command: |+ pwd register: result - name: get debug result debug: var=result v
阅读全文
摘要:install mysql - hosts: gale remote_user: root gather_facts: no tasks: - name: install packages yum: name=libaio,perl - {name: create group, group: nam
阅读全文