main.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. - import_tasks: init.yml
  2. - name: add PPA for Ubuntu Toolchain
  3. become: true
  4. ansible.builtin.apt_repository:
  5. repo: ppa:ubuntu-toolchain-r/test
  6. when: ansible_distribution == 'Ubuntu'
  7. # https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable
  8. - name: Add an yarn signing key
  9. become: true
  10. ansible.builtin.apt_key:
  11. url: https://dl.yarnpkg.com/debian/pubkey.gpg
  12. state: present
  13. when: ansible_distribution == 'Ubuntu'
  14. - name: Add an yarn package repository
  15. become: true
  16. ansible.builtin.lineinfile:
  17. path: /etc/apt/sources.list.d/yarn.list
  18. line: "deb https://dl.yarnpkg.com/debian/ stable main"
  19. create: true
  20. when: ansible_distribution == 'Ubuntu'
  21. - name: Install nodejs
  22. become: true
  23. community.general.snap:
  24. name: node
  25. classic: true
  26. - name: Update system
  27. become: true
  28. apt:
  29. upgrade: yes
  30. update_cache: yes
  31. cache_valid_time: 3600
  32. - name: Install dependicy packages
  33. become: true
  34. apt:
  35. pkg:
  36. - apt-transport-https
  37. - software-properties-common
  38. - gnupg
  39. - openssh-server
  40. - openssh-client
  41. - sshpass
  42. - wpasupplicant
  43. - rsync
  44. - at
  45. - sysstat
  46. - libtool
  47. - ethtool
  48. - dnsutils
  49. - dnsmasq
  50. - uuid-runtime
  51. - lshw
  52. - tcpdump
  53. - lm-sensors
  54. - dmidecode
  55. - net-tools
  56. - iputils-arping
  57. - iputils-ping
  58. - telnet
  59. - vim
  60. - git
  61. - pwgen
  62. - locales
  63. - ntpdate
  64. - imagemagick
  65. - mpg123
  66. - ffmpeg
  67. - sqlite3
  68. - tree
  69. - alsa-utils
  70. - pulseaudio
  71. - zsh
  72. - wget
  73. - curl
  74. - zip
  75. - unzip
  76. - nginx
  77. - libnginx-mod-http-upstream-fair
  78. - certbot
  79. - python3-certbot-nginx
  80. - openvpn
  81. - snmpd
  82. - mutt
  83. - systemd-cron
  84. - screen
  85. - tmux
  86. - hugo
  87. - yarn
  88. - python3
  89. - python3-pip
  90. - python3-distutils
  91. - python3-dev
  92. - libssl-dev
  93. - libpq-dev
  94. - libmysqlclient-dev
  95. - libevent-dev
  96. - crun
  97. - podman
  98. - buildah
  99. - fuse-overlayfs
  100. - name: Install dependicy packages(>bionic)
  101. become: true
  102. apt:
  103. pkg:
  104. - systemd-timesyncd
  105. # ansible_facts['distribution'] == "Ubuntu"
  106. when: ansible_facts['distribution_major_version'] | int >= 20
  107. - import_tasks: locales.yml
  108. - name: Set default editor to vim
  109. become: true
  110. shell: update-alternatives --set editor /usr/bin/vim.basic
  111. - name: Set timezone
  112. become: true
  113. shell: timedatectl set-timezone UTC
  114. - name: Set git rebase mode
  115. become: true
  116. shell: git config --global pull.rebase false
  117. - import_tasks: zsh.yml
  118. # ---------------------------------------------------
  119. - name: enable nginx service
  120. become: true
  121. ansible.builtin.systemd:
  122. name: nginx
  123. enabled: yes
  124. masked: no
  125. - name: enable cron service
  126. become: true
  127. ansible.builtin.systemd:
  128. name: cron
  129. enabled: yes
  130. masked: no
  131. - name: enable ssh service
  132. become: true
  133. ansible.builtin.systemd:
  134. name: ssh
  135. enabled: yes
  136. masked: no
  137. - name: enable systemd-timesyncd service
  138. become: true
  139. ansible.builtin.systemd:
  140. name: systemd-timesyncd
  141. enabled: yes
  142. masked: no
  143. - import_tasks: clean.yml