Skip to content

Commit 9428d42

Browse files
authored
Installer pr 2.x (#1735)
* Creating a ce-provision installer script. * Updating installation docs. * Adding pip upgrade line and python-debian. * Updating docs. * Some minor installer bug fixes.
1 parent 939d1e3 commit 9428d42

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

docs/install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sudo ./install.sh -h # for usage information
1818
# Default installation (ce-provision only)
1919
sudo ./install.sh
2020
# Installation with GitLab CE using a self-signed SSL certificate
21-
sudo ./install.sh --gitlab https://gitlab.example.com
21+
sudo ./install.sh --gitlab gitlab.example.com
2222
# Installation with GitLab CE using a LetsEncrypt SSL certificate (requires DNS to be set up in advance)
23-
sudo ./install.sh --letsencrypt --gitlab https://gitlab.example.com
23+
sudo ./install.sh --letsencrypt --gitlab gitlab.example.com
2424
```
2525

2626
## Install with ce-provision

install.sh

+20-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ usage(){
1515
echo '--user: Ansible controller user (default: controller)'
1616
echo '--config: Git URL to your ce-provision Ansible config repository (default: https://github.com/codeenigma/ce-provision-config-example.git)'
1717
echo '--config-branch: branch of your Ansible config repository to use (default: 1.x)'
18-
echo '--gitlab: install GitLab CE on this server (default: no, set to desired GitLab URL to install)'
18+
echo '--gitlab: install GitLab CE on this server (default: no, set to desired GitLab address to install, e.g. gitlab.example.com)'
1919
echo '--letsencrypt: try to create an SSL certificate with LetsEncrypt (requires DNS pointing at this server for provided GitLab URL)'
2020
echo '--aws: enable AWS support'
2121
echo ''
@@ -133,7 +133,7 @@ echo "-------------------------------------------------"
133133
# Install Ansible in a Python virtual environment.
134134
echo "Install Ansible and dependencies."
135135
echo "-------------------------------------------------"
136-
su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ansible"
136+
su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ce-python"
137137
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/python3 -m pip install --upgrade pip"
138138
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install ansible netaddr python-debian"
139139
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-galaxy collection install ansible.posix --force"
@@ -151,7 +151,7 @@ else
151151
echo "ce-provision directory at /home/$CONTROLLER_USER/ce-provision already exists. Skipping."
152152
echo "-------------------------------------------------"
153153
fi
154-
# Create playbook.
154+
# Create playbook for ce-provision.
155155
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/provision.yml" << EOL
156156
---
157157
- hosts: "localhost"
@@ -162,9 +162,6 @@ fi
162162
- name: Install ce-provision.
163163
ansible.builtin.import_role:
164164
name: debian/ce_provision
165-
- name: Install iptables firewall.
166-
ansible.builtin.import_role:
167-
name: debian/firewall_config
168165
EOL
169166
# Create vars file.
170167
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/vars.yml" << EOL
@@ -220,6 +217,23 @@ firewall_config:
220217
- "443"
221218
EOL
222219
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-playbook /home/$CONTROLLER_USER/ce-provision/provision.yml"
220+
rm "/home/$CONTROLLER_USER/ce-provision/provision.yml"
221+
# Create playbook for firewall.
222+
echo "-------------------------------------------------"
223+
echo "Install firewall."
224+
echo "-------------------------------------------------"
225+
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/provision.yml" << EOL
226+
---
227+
- hosts: "localhost"
228+
become: true
229+
vars_files:
230+
- vars.yml
231+
tasks:
232+
- name: Install iptables firewall.
233+
ansible.builtin.import_role:
234+
name: debian/firewall_config
235+
EOL
236+
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-playbook /home/$CONTROLLER_USER/ce-provision/provision.yml"
223237
echo "-------------------------------------------------"
224238

225239
# Install GitLab

install/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sudo ./install.sh -h # for usage information
1818
# Default installation (ce-provision only)
1919
sudo ./install.sh
2020
# Installation with GitLab CE using a self-signed SSL certificate
21-
sudo ./install.sh --gitlab https://gitlab.example.com
21+
sudo ./install.sh --gitlab gitlab.example.com
2222
# Installation with GitLab CE using a LetsEncrypt SSL certificate (requires DNS to be set up in advance)
23-
sudo ./install.sh --letsencrypt --gitlab https://gitlab.example.com
23+
sudo ./install.sh --letsencrypt --gitlab gitlab.example.com
2424
```
2525

2626
## Install with ce-provision

0 commit comments

Comments
 (0)