diff --git a/CTbase.yml b/CTbase.yml index 827214e..34e5858 100644 --- a/CTbase.yml +++ b/CTbase.yml @@ -2,7 +2,6 @@ - hosts: test roles: - common - - nginx # déclaration de la variables globales vars: diff --git a/bim!chat.yml b/bim!chat.yml index a57ef81..ef22906 100644 --- a/bim!chat.yml +++ b/bim!chat.yml @@ -10,6 +10,6 @@ # Déclaration des variables globales vars: - email: contact@iloth.net + email: contact@bim.land domain: chat.bim.land cthostname: chat diff --git a/bimsocial.yml b/bimsocial.yml index 87b7026..468cdc0 100644 --- a/bimsocial.yml +++ b/bimsocial.yml @@ -1,10 +1,10 @@ --- - hosts: bim roles: - #- common - #- rbenv - #- nginx - #- postgresql + - common + - rbenv + - nginx + - postgresql - mastodon # Déclaration des variables globales @@ -15,4 +15,6 @@ create_user: true username: mastodon installCertbot: true + debian_version: buster + nodejs_version: 12 ruby_version: 2.7.2 diff --git a/roles/nodejs/README.md b/roles/nodejs/README.md new file mode 100644 index 0000000..e69de29 diff --git a/roles/nodejs/defaults/main.yml b/roles/nodejs/defaults/main.yml new file mode 100644 index 0000000..5a41b09 --- /dev/null +++ b/roles/nodejs/defaults/main.yml @@ -0,0 +1,5 @@ +requiredPackages: + - apt-transport-https + +nodejs_version: 12 +debian_version: buster diff --git a/roles/nodejs/tasks/main.yml b/roles/nodejs/tasks/main.yml new file mode 100644 index 0000000..1b8b3fd --- /dev/null +++ b/roles/nodejs/tasks/main.yml @@ -0,0 +1,14 @@ +- name: Add Nodejs apt key + apt_key: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + state: present + +- name: Add Nodes 12 repository + apt_repository: + repo: deb https://deb.nodesource.com/node_"{{ nodejs_version }}".x "{{ debian_version }}" main + state: present + +- name: Install NodeJs + apt: + name: nodejs + state: present diff --git a/roles/rbenv/files/rbenv_installer.sh b/roles/rbenv/files/rbenv_installer.sh deleted file mode 100644 index f426db6..0000000 --- a/roles/rbenv/files/rbenv_installer.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -set -e - -homebrew= -type -p brew >/dev/null && homebrew=1 - -try_bash_extension() { - if [ -x src/configure ]; then - src/configure && make -C src || { - echo "Optional bash extension failed to build, but things will still work normally." - } - fi -} - -if ! type -p git >/dev/null; then - git() { - echo "Error: git is required to proceed. Please install git and try again." >&2 - exit 1 - } -fi - -http() { - local url="$1" - if type -p curl >/dev/null; then - curl -fsSL "$url" - elif type -p wget >/dev/null; then - wget -q "$url" -O- - else - echo "Error: couldn't download file. No \`curl' or \`wget' found." >&2 - return 1 - fi -} - -rbenv="$(command -v rbenv ~/.rbenv/bin/rbenv | head -1)" - -if [ -n "$rbenv" ]; then - echo "rbenv already seems installed in \`$rbenv'." - cd "${rbenv%/*}" - - if [ -x ./brew ]; then - echo "Trying to update with Homebrew..." - brew update >/dev/null - if [ "$(./rbenv --version)" < "1.0.0" ] && brew list rbenv | grep -q rbenv/HEAD; then - brew uninstall rbenv - brew install rbenv --without-ruby-build - else - brew upgrade rbenv - fi - elif git remote -v 2>/dev/null | grep -q rbenv; then - echo "Trying to update with git..." - git pull --tags origin master - cd .. - try_bash_extension - fi -else - if [ -n "$homebrew" ]; then - echo "Installing rbenv with Homebrew..." - brew update - brew install rbenv --without-ruby-build - rbenv="$(brew --prefix)/bin/rbenv" - else - echo "Installing rbenv with git..." - mkdir -p ~/.rbenv - cd ~/.rbenv - git init - git remote add -f -t master origin https://github.com/rbenv/rbenv.git - git checkout -b master origin/master - try_bash_extension - rbenv=~/.rbenv/bin/rbenv - - if [ ! -e versions ] && [ -w /opt/rubies ]; then - ln -s /opt/rubies versions - fi - fi -fi - -rbenv_root="$("$rbenv" root)" -ruby_build="$(command -v "$rbenv_root"/plugins/*/bin/rbenv-install rbenv-install | head -1)" - -echo -if [ -n "$ruby_build" ]; then - echo "\`rbenv install' command already available in \`$ruby_build'." - cd "${ruby_build%/*}" - - if [ -x ./brew ]; then - echo "Trying to update with Homebrew..." - brew update >/dev/null - brew upgrade ruby-build - elif git remote -v 2>/dev/null | grep -q ruby-build; then - echo "Trying to update with git..." - git pull origin master - fi -else - if [ -n "$homebrew" ]; then - echo "Installing ruby-build with Homebrew..." - brew update - brew install ruby-build - else - echo "Installing ruby-build with git..." - mkdir -p "${rbenv_root}/plugins" - git clone https://github.com/rbenv/ruby-build.git "${rbenv_root}/plugins/ruby-build" - fi -fi - -# Enable caching of rbenv-install downloads -mkdir -p "${rbenv_root}/cache" - -echo -echo "Running doctor script to verify installation..." -http https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | "$BASH" - -echo -echo "All done!" -echo "Note that this installer doesn't yet configure your shell startup files:" -i=0 -if [ -x ~/.rbenv/bin ]; then - echo "$((++i)). You'll want to ensure that \`~/.rbenv/bin' is added to PATH." -fi -echo "$((++i)). Run \`rbenv init' to see instructions how to configure rbenv for your shell." -echo "$((++i)). Launch a new terminal window to verify that the configuration is correct." -echo diff --git a/roles/yarn/README.md b/roles/yarn/README.md new file mode 100644 index 0000000..e69de29 diff --git a/roles/yarn/tasks/main.yml b/roles/yarn/tasks/main.yml new file mode 100644 index 0000000..9c7df36 --- /dev/null +++ b/roles/yarn/tasks/main.yml @@ -0,0 +1,17 @@ +--- +--- + +- name: Add Yarn apt key + apt_key: + url: https://dl.yarnpkg.com/debian/pubkey.gpg + state: present + +- name: Add Yarn Repository + apt_repository: + repo: deb https://dl.yarnpkg.com/debian/ stable main + state: present + +- name: Install Yarn + apt: + name: yarn + state: present