Skip to content
Snippets Groups Projects
Commit ee5d98ec authored by jurgenhaas's avatar jurgenhaas
Browse files

Replace deprecated "sudo" with "become"

parent 1173c3e7
No related branches found
No related tags found
No related merge requests found
---
- name: install prerequisites
sudo: yes
become: yes
apt:
name: "{{ item}}"
state: present
......@@ -25,7 +25,7 @@
- nginx
- name: create git user
sudo: yes
become: yes
user:
name: git
comment: "GitLab"
......@@ -33,7 +33,7 @@
state: present
- name: configure git
sudo: yes
become: yes
copy:
src: gitconfig
dest: /home/git/.gitconfig
......@@ -42,7 +42,7 @@
mode: 0664
- name: create database user
sudo: yes
become: yes
sudo_user: postgres
postgresql_user:
name: git
......@@ -50,7 +50,7 @@
state: present
- name: create database table
sudo: yes
become: yes
sudo_user: postgres
postgresql_db:
name: gitlabhq_production
......@@ -58,7 +58,7 @@
state: present
- name: clone gitlab source
sudo: yes
become: yes
sudo_user: git
git:
repo: https://gitlab.com/gitlab-org/gitlab-ce.git
......@@ -96,7 +96,7 @@
- { key: "email_reply_to" , value: "{{ gitlab_config_email_reply_to }}" }
- name: setup folder permissions
sudo: yes
become: yes
file:
path: "{{ item }}"
state: directory
......@@ -110,25 +110,25 @@
- /home/git/gitlab-satellites
- name: reduce permissions for log directory
sudo: yes
become: yes
file:
path: /home/git/gitlab/log
mode: go-w
- name: reduce permissions for database config
sudo: yes
become: yes
file:
path: /home/git/gitlab/config/database.yml
mode: o-rwx
- name: reduce permissions for gitlab-satellites directory
sudo: yes
become: yes
file:
path: /home/git/gitlab-satellites
mode: g=rx,o-rwx
- name: install gems
sudo: yes
become: yes
sudo_user: git
command: bundle install -j8 --deployment --without development test mysql aws kerberos
args:
......@@ -136,7 +136,7 @@
when: result | changed
- name: install gitlab shell
sudo: yes
become: yes
sudo_user: git
command: bundle exec rake gitlab:shell:install[v2.6.3] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
args:
......@@ -144,7 +144,7 @@
when: result | changed
- name: initialize database
sudo: yes
become: yes
sudo_user: git
command: echo yes | bundle exec rake gitlab:setup RAILS_ENV=production
args:
......@@ -162,13 +162,13 @@
enabled: yes
- name: setup logrotate
sudo: yes
become: yes
command: cp /home/git/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
args:
creates: /etc/logrotate.d/gitlab
- name: compile assets
sudo: yes
become: yes
sudo_user: git
command: bundle exec rake assets:precompile RAILS_ENV=production
args:
......@@ -176,25 +176,25 @@
when: result | changed
- name: start gitlab instance
sudo: yes
become: yes
service:
name: gitlab
state: running
- name: copy nginx configuration from gitlab
sudo: yes
become: yes
command: cp /home/git/gitlab/lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
args:
creates: /etc/nginx/sites-available/gitlab
- name: activate nginx gitlab site
sudo: yes
become: yes
command: ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
args:
creates: /etc/nginx/sites-enabled/gitlab
- name: deactivate nginx default site
sudo: yes
become: yes
command: rm -f /etc/nginx/sites-enabled/default
- name: set FQND in gitlab config
......@@ -204,7 +204,7 @@
replace: "{{ gitlab_config_host }}"
- name: restart nginx
sudo: yes
become: yes
service:
name: nginx
state: restarted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment