ansible roles rsync

 

ansible roles rsync

- name: Install Ryync Servers
  yum: 
    name: rsync
    state: present
- name: Create www group
  group: 
   name: www
   gid: 666
- name: create user www
  user:  
    name: www
    uid: 666
    group: www
    shell: /sbin/nologin
    create_home: false
      
- name: copy rsync configure File
  template:
        src: "{{ item.src }}"
        dest: "{{ item.dest }}"
        mode: "{{ item.mode}}"
  loop:
    - {src: rsyncd.conf.j2, dest: /etc/rsyncd.conf, mode: '0644'}
    - {src: rsync.passwd.j2, dest: /etc/rsync.passwd,mode: '0600'}
  notify: Restart Rsyncd Server
  


- name: Create Dir "{{ rsync_dir }}"
  file:
    path: /{{ rsync_dir }}
    state: directory
    owner: "{{ rs_user }}"
    group: "{{ rsg_user }}"
- name: Start Rsync Server
  systemd:
    name: rsyncd
    state: started
    enabled: yes

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章