init.sls 800 B

12345678910111213141516171819202122232425262728293031323334
  1. #
  2. # mongodb
  3. #
  4. mongodb-repo-4.2:
  5. pkgrepo.managed:
  6. - humanname: MongoDB Repo
  7. - name: deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main
  8. - file: /etc/apt/sources.list.d/mongodb-org-4.2.list
  9. - key_url: https://www.mongodb.org/static/pgp/server-4.2.asc
  10. mongodb:
  11. pkg.installed:
  12. - name: mongodb-org
  13. service.running:
  14. - name: mongod
  15. - enable: True
  16. # Install cronjob, backup script and corresponding config file
  17. /etc/cron.d/mongodb_backup:
  18. file.managed:
  19. - source: salt://mongodb/mongodb_backup.cron
  20. /usr/local/sbin/mongodb_backup:
  21. file.managed:
  22. - source: salt://mongodb/mongodb_backup
  23. - mode: 755
  24. /etc/mongodb_backup.conf:
  25. file.managed:
  26. - source: salt://mongodb/mongodb_backup.conf
  27. - mode: 600
  28. - user: root
  29. - group: root