base.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. - name: Write /etc/apt/sources.list
  2. action: template src=apt/sources.${ansible_lsb.codename}.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
  3. notify:
  4. - Reload apt cache
  5. - name: Write /etc/apt/apt.conf.d configuration files
  6. action: template src=apt/${item}.j2 dest=/etc/apt/apt.conf.d/${item} owner=root group=root mode=0644
  7. with_items:
  8. - local-recommends
  9. - local-pdiffs
  10. - name: Install base packages
  11. action: ${ansible_pkg_mgr} pkg=${item} install_recommends=no state=installed update_cache=yes
  12. with_items:
  13. - apticron
  14. - locales-all
  15. - lsb-release
  16. - ntp
  17. - toilet
  18. - toilet-fonts
  19. - facter
  20. - zsh
  21. - git-core
  22. - vim-nox
  23. - ccze
  24. - tree
  25. - pydf
  26. - htop
  27. - sudo
  28. - name: Install hosts file
  29. action: template src=hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
  30. notify:
  31. - Update motd
  32. - name: Install hosts.deny file
  33. action: template src=hosts.deny.j2 dest=/etc/hosts.deny owner=root group=root mode=0644
  34. - name: Install sudo configuration
  35. action: template src=sudo/local-admin.j2 dest=/etc/sudoers.d/local-admin owner=root group=root mode=0440
  36. - name: Install unprivileged user
  37. action: user name="${admin_user}" comment="${admin_fullname}" groups=adm,operator,sudo append=yes shell=/bin/zsh state=present
  38. - name: Install configuration files for user
  39. action: git repo=git://git.openics.org/kolter-dotfiles.git dest=/home/${admin_user}
  40. - name: Install SSH key for unprivileged user
  41. action: authorized_key user="${admin_user}" key="$FILE(roles/common/data/users/${admin_user}/id_rsa.pub)" state=present
  42. - name: Install SSH key for root
  43. action: authorized_key user=root key="$FILE(roles/common/data/users/${admin_user}/id_rsa.pub)" state=present