<commit_before>---
- hosts: raspicams
  vars:
      # syslog server receiving logs from raspicams
      syslog_host: 192.168.1.1
      syslog_port: 51400
      interfaces_o2__wpa_ssid: O2
      interfaces_o2__wpa_psk: "wr300Mgb."
      interfaces_o2ex__wpa_ssid: O2_2EX
      interfaces_o2ex__wpa_psk: "wr300Mgb."
  tasks:
      - copy:
          src: config/etc/
          dest: /etc/
      - copy:
          src: config/usr/local/bin/
          dest: /usr/local/bin/
          owner: root
          group: staff
          mode: u=rwx,g=rx,o=rx
      - copy:
          src: config/usr/local/sbin/
          dest: /usr/local/sbin/
          owner: root
          group: staff
          mode: u=rwx,g=rx,o=rx
      - template:
          src: template/etc/rsyslog.d/tcp.conf
          dest: /etc/rsyslog.d/tcp.conf
      - package:
          name: motion
          state: present
      - package:
          name: tree
          state: present
      - package:
          name: vim
          state: present
      - package:
          name: i2c-tools
          state: present
      - file:
          src: /usr/local/sbin/remove-old-records
          dest: /etc/cron.daily/remove-old-records
          state: link
      #- user:
          #name: motion
          #home: /home/motion
          #move_home: yes
      #- group:
          #name: motion
      - blockinfile:
          path: /etc/dhcpcd.conf
          content: |
              interface eth0
              static ip_address=192.168.2.2
              static routers=192.168.2.1
      - blockinfile:<commit_msg>[raspicam]: Restart motion if not working<commit_after>---
- hosts: raspicams
  vars:
      # syslog server receiving logs from raspicams
      syslog_host: 192.168.1.1
      syslog_port: 51400
      interfaces_o2__wpa_ssid: O2
      interfaces_o2__wpa_psk: "wr300Mgb."
      interfaces_o2ex__wpa_ssid: O2_2EX
      interfaces_o2ex__wpa_psk: "wr300Mgb."
  tasks:
      - copy:
          src: config/etc/
          dest: /etc/
      - copy:
          src: config/usr/local/bin/
          dest: /usr/local/bin/
          owner: root
          group: staff
          mode: u=rwx,g=rx,o=rx
      - copy:
          src: config/usr/local/sbin/
          dest: /usr/local/sbin/
          owner: root
          group: staff
          mode: u=rwx,g=rx,o=rx
      - template:
          src: template/etc/rsyslog.d/tcp.conf
          dest: /etc/rsyslog.d/tcp.conf
      - package:
          name: motion
          state: present
      - package:
          name: tree
          state: present
      - package:
          name: vim
          state: present
      - package:
          name: i2c-tools
          state: present
      - file:
          src: /usr/local/sbin/remove-old-records
          dest: /etc/cron.daily/remove-old-records
          state: link
      - cron:
          name: 'check motion'
          job: 'systemctl status motion || systemctl restart motion'
      #- user:
          #name: motion
          #home: /home/motion
          #move_home: yes
      #- group:
          #name: motion
      - blockinfile:
          path: /etc/dhcpcd.conf
          content: |
              interface eth0
              static ip_address=192.168.2.2
              static routers=192.168.2.1
      - blockinfile:
{'fraction_non_alphanumeric': 0.09938837920489296, 'fraction_numerical': 0.02691131498470948, 'mean_word_length': 1.36002886002886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6861644', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1076, 'n_words': 221}