--- - name: create E-Mail reboot script template: src: templates/sendmail-reboot.sh dest: /etc/init.d/sendmail-reboot.sh mode: u=rwx,g=rx,o=rx - name: install E-Mail init script link shell: cmd: "chkconfig --add /etc/init.d/sendmail-reboot.sh" - name: create Telegram reboot script template: src: templates/sendtelegram-reboot.sh dest: /etc/init.d/sendtelegram-reboot.sh mode: u=rwx,g=rx,o=rx - name: install Telegram init script link shell: cmd: "chkconfig --add /etc/init.d/sendtelegram-reboot.sh" - name: check that the sendmail-reboot.sh exists stat: path: /etc/init.d/sendmail-reboot.sh register: stat_result - name: replace python interpriter, if sendmail-reboot.sh exist shell: sed -i "s/python3/\/usr\/local\/bin\/python3.9/" /etc/init.d/sendmail-reboot.sh when: stat_result.stat.exists args: warn: false - name: check that the sendtelegram-login.sh exists stat: path: /etc/profile.d/sendtelegram-login.sh register: stat_result - name: replace python interpriter, if sendtelegram-login.sh exist shell: sed -i "s/python3/\/usr\/local\/bin\/python3.9/" /etc/profile.d/sendtelegram-login.sh when: stat_result.stat.exists args: warn: false