Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 7ada3df8 authored by Jean-François HOVINNE's avatar Jean-François HOVINNE
Browse files

feat: Implement playbook

parents
No related branches found
No related tags found
No related merge requests found
variables:
PLAYBOOK: ${CI_PROJECT_NAME}
BRANCH: ${CI_COMMIT_REF_NAME}
test:
trigger:
project: ecgalaxy/tooling
strategy: depend
# ECGALAXY PHP developer playbook
An Ansible playbook covering Linux desktop environments and installing the base tools allowing PHP development.
## Requirements
[Ansible](https://www.ansible.com/) is required, see [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
On Amazon Linux 2 and AWS WorkSpaces, Ansible can be quickly installed with `amazon-linux-extras`:
`sudo amazon-linux-extras install ansible2`
Alternatively, you can create a virtual environment and install Ansible within it:
`python3 -m venv venv && source venv/bin/activate && pip install --upgrade pip && pip install ansible`
Ansible will then be available in the current shell, and the virtual environment can be deleted after execution of the playbook:
`deactivate && rm -rf venv`
## Usage
First, clone this repository and open a terminal in its directory.
Then 'install' the required roles:
`ansible-galaxy install -r requirements.yml --force`
The above command imports the Ansible roles source code from their repositories, which are listed in the `requirements.yml` file.
Finally, run the playbook against your inventory.
The below command will execute the playbook locally:
`ansible-playbook --connection=local -i localhost, playbook.yml --ask-become-pass`
The `become` password corresponds to your current user password, which needs `sudo` permissions.
## Optional
You can remove 'roles' you do not need by editing the `playbook.yml` file.
See [Working with playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html) for more information on how to use Ansible playbooks.
---
- hosts: all
roles:
- ecgalaxy.bootstrap
- ecgalaxy.common_packages
- ecgalaxy.oracle_instantclient
- ecgalaxy.php
- ecgalaxy.vscode
vars:
vscode_extensions:
- ms-azuretools.vscode-docker
- ms-vscode-remote.remote-containers
- xdebug.php-pack
---
- ecgalaxy.bootstrap
- ecgalaxy.common_packages
- ecgalaxy.oracle_instantclient
- ecgalaxy.php
- ecgalaxy.vscode
def test_commands(host):
cmd = host.run('git --version')
assert cmd.rc == 0
cmd = host.run('php --version')
assert cmd.rc == 0
cmd = host.run('code --version')
assert cmd.rc == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment