Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer pr 2.x #1735

Merged
merged 13 commits into from
May 29, 2024
4 changes: 2 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ sudo ./install.sh -h # for usage information
# Default installation (ce-provision only)
sudo ./install.sh
# Installation with GitLab CE using a self-signed SSL certificate
sudo ./install.sh --gitlab https://gitlab.example.com
sudo ./install.sh --gitlab gitlab.example.com
# Installation with GitLab CE using a LetsEncrypt SSL certificate (requires DNS to be set up in advance)
sudo ./install.sh --letsencrypt --gitlab https://gitlab.example.com
sudo ./install.sh --letsencrypt --gitlab gitlab.example.com
```

## Install with ce-provision
Expand Down
26 changes: 20 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ usage(){
echo '--user: Ansible controller user (default: controller)'
echo '--config: Git URL to your ce-provision Ansible config repository (default: https://github.com/codeenigma/ce-provision-config-example.git)'
echo '--config-branch: branch of your Ansible config repository to use (default: 1.x)'
echo '--gitlab: install GitLab CE on this server (default: no, set to desired GitLab URL to install)'
echo '--gitlab: install GitLab CE on this server (default: no, set to desired GitLab address to install, e.g. gitlab.example.com)'
echo '--letsencrypt: try to create an SSL certificate with LetsEncrypt (requires DNS pointing at this server for provided GitLab URL)'
echo '--aws: enable AWS support'
echo ''
Expand Down Expand Up @@ -133,7 +133,7 @@ echo "-------------------------------------------------"
# Install Ansible in a Python virtual environment.
echo "Install Ansible and dependencies."
echo "-------------------------------------------------"
su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ansible"
su - "$CONTROLLER_USER" -c "/usr/bin/python3 -m venv /home/$CONTROLLER_USER/ce-python"
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/python3 -m pip install --upgrade pip"
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/pip install ansible netaddr python-debian"
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-galaxy collection install ansible.posix --force"
Expand All @@ -151,7 +151,7 @@ else
echo "ce-provision directory at /home/$CONTROLLER_USER/ce-provision already exists. Skipping."
echo "-------------------------------------------------"
fi
# Create playbook.
# Create playbook for ce-provision.
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/provision.yml" << EOL
---
- hosts: "localhost"
Expand All @@ -162,9 +162,6 @@ fi
- name: Install ce-provision.
ansible.builtin.import_role:
name: debian/ce_provision
- name: Install iptables firewall.
ansible.builtin.import_role:
name: debian/firewall_config
EOL
# Create vars file.
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/vars.yml" << EOL
Expand Down Expand Up @@ -220,6 +217,23 @@ firewall_config:
- "443"
EOL
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-playbook /home/$CONTROLLER_USER/ce-provision/provision.yml"
rm "/home/$CONTROLLER_USER/ce-provision/provision.yml"
# Create playbook for firewall.
echo "-------------------------------------------------"
echo "Install firewall."
echo "-------------------------------------------------"
/usr/bin/cat >"/home/$CONTROLLER_USER/ce-provision/provision.yml" << EOL
---
- hosts: "localhost"
become: true
vars_files:
- vars.yml
tasks:
- name: Install iptables firewall.
ansible.builtin.import_role:
name: debian/firewall_config
EOL
su - "$CONTROLLER_USER" -c "/home/$CONTROLLER_USER/ce-python/bin/ansible-playbook /home/$CONTROLLER_USER/ce-provision/provision.yml"
echo "-------------------------------------------------"

# Install GitLab
Expand Down
4 changes: 2 additions & 2 deletions install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ sudo ./install.sh -h # for usage information
# Default installation (ce-provision only)
sudo ./install.sh
# Installation with GitLab CE using a self-signed SSL certificate
sudo ./install.sh --gitlab https://gitlab.example.com
sudo ./install.sh --gitlab gitlab.example.com
# Installation with GitLab CE using a LetsEncrypt SSL certificate (requires DNS to be set up in advance)
sudo ./install.sh --letsencrypt --gitlab https://gitlab.example.com
sudo ./install.sh --letsencrypt --gitlab gitlab.example.com
```

## Install with ce-provision
Expand Down
Loading