main.yml 1.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
---

  - stat: path=/etc/etckeeper/etckeeper.conf
    register: etckeeper_configuration

  - stat: path:/etc/.gitignore
    register: gitignore_file

  - name: Install git
    apt: name=git state=latest update_cache=no 
    when: ansible_os_family == "Debian"

  - name: Install git
    yum: name=git state=latest update_cache=no  
    when: ansible_os_family == "RedHat"

  - name: Install etckeeper
    apt: name=etckeeper state=latest update_cache=no 
    when: ansible_os_family == "Debian"

  - name: Install etckeeper
    yum: name=etckeeper state=latest update_cache=no  
    when: ansible_os_family == "RedHat"

  - shell: etckeeper uninit
    args:
      chdir: /etc

  - shell: etckeeper init
    args:
      chdir: /etc

    # invoke git checkout -b `hostname ` or `COMP-XXX` for initial registration.

  - lineinfile: path=/etc/.gitignore line={{ item }}
    with_items:
      - ~*
      - shadow*
      - passwd*
      - groups*
      - re6stnet/ca.crt
      - re6stnet/cert.crt
      - re6stnet/cert.key
      - opt/slapos/ssl

  
  # Get this configuration from /etc/opt/vifib-etckeeper-email
  - shell: git config user.email 
    args:
      chdir: /etc

  # Get this configuration from /etc/opt/vifib-etckeeper-name
  - shell: git config user.name 
    args:
      chdir: /etc

  - shell: git checkout -b `???`

  - shell: git commit -a -m "Initial Commit"

  # get URL of repos at a local file on /etc/opt/vifib-etckeeper-repository instead
  - shell: git remote add origin 

  # edit /etc/etckeeper/