Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
90aeb2c
Improving AWS subnet docs.
gregharvey Nov 22, 2023
c277047
Merge branch '2.x' into bug_fixes_2.x
gregharvey Nov 30, 2023
97570e3
Merge branch '2.x' into bug_fixes_2.x
gregharvey Dec 12, 2023
7c31b40
Error in timers structure in the SSL role.
gregharvey Dec 12, 2023
44a4d87
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 12, 2023
fd6c81b
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 12, 2023
8a5acaa
Merge branch '2.x' into bug_fixes_2.x
gregharvey Dec 21, 2023
b75fe03
Removing obsolete backports requirements.
gregharvey Dec 21, 2023
c57b886
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
b270172
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
5b27a8c
Allow the billing role to access Sustainability information.
gregharvey Dec 21, 2023
053097b
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
23bec8f
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
883e323
Merge branch '2.x' into bug_fixes_2.x
gregharvey Dec 21, 2023
dff1847
Merge branch '2.x' into bug_fixes_2.x
gregharvey Dec 21, 2023
9ca4148
Missing comma in IAM billing policy.
gregharvey Dec 21, 2023
1e07a78
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
fa8c5dc
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Dec 21, 2023
d753fad
Merge branch '2.x' into bug_fixes_2.x
gregharvey Jan 9, 2024
c8199be
Removing broken GitLab Runner code.
gregharvey Jan 9, 2024
e1b01a8
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 9, 2024
c222fec
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 9, 2024
0ba4138
Fixed the include_role task in gitlab_runner.
gregharvey Jan 10, 2024
aacf70b
Suppressing a failure if there is no system pip to call.
gregharvey Jan 10, 2024
8b20f84
Merge branch '2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 10, 2024
6357281
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 10, 2024
c634ef5
Logic error in Ansible installer username, needs to be set from calli…
gregharvey Jan 10, 2024
7e5fb2b
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 10, 2024
2673659
ansible_user is a reserved variable, seems to be causing issues.
gregharvey Jan 10, 2024
3dbd017
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 10, 2024
c6af4c0
_ansible_ANYTHING is reserved, using _install_username instead.
gregharvey Jan 10, 2024
2c487c2
Merge branch 'bug_fixes_2.x' into bug_fixes_2.x-PR-2.x
gregharvey Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/roles/debian/ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ Note, it is vitally important that Ansible is *not* installed via `apt` or `pip`
```yaml
---
ce_ansible:
# These are usually set within another role using _venv_path and _venv_command but can be overridden.
# These are usually set within another role using _venv_path, _venv_command and _install_username but can be overridden.
#venv_path: "/home/{{ ce_provision.username }}/ansible"
#venv_command: /usr/bin/python3.11 -m venv
#install_username: deploy # user to become when creating venv
upgrade:
enabled: true # create systemd timer to auto-upgrade Ansible
command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too
Expand Down
1 change: 1 addition & 0 deletions docs/roles/debian/ce_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ce_deploy:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_deploy.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_deploy.username }}"
# Other ce-deploy settings.
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
key_name: id_rsa.pub # existing users may have a key of a different name
Expand Down
1 change: 1 addition & 0 deletions docs/roles/debian/ce_provision.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ce_provision:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_provision.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_provision.username }}"
# Other ce-provision settings.
username: "{{ _ce_provision.username }}"
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
Expand Down
1 change: 1 addition & 0 deletions docs/roles/debian/gitlab_runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ gitlab_runner:
# see https://gitlab.com/gitlab-org/ci-cd/custom-executor-drivers/fargate/-/tree/master/docs
fargate:
cluster: "my-cluster" # ECS cluster name
profile: "{{ _aws_profile }}"
region: "eu-west-1" # AWS region name
subnet: "subnet-abcdef123456" # subnet ID
security_group: "my-security-group" # SG name
Expand Down
3 changes: 2 additions & 1 deletion roles/debian/ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ Note, it is vitally important that Ansible is *not* installed via `apt` or `pip`
```yaml
---
ce_ansible:
# These are usually set within another role using _venv_path and _venv_command but can be overridden.
# These are usually set within another role using _venv_path, _venv_command and _install_username but can be overridden.
#venv_path: "/home/{{ ce_provision.username }}/ansible"
#venv_command: /usr/bin/python3.11 -m venv
#install_username: deploy # user to become when creating venv
upgrade:
enabled: true # create systemd timer to auto-upgrade Ansible
command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too
Expand Down
3 changes: 2 additions & 1 deletion roles/debian/ansible/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
ce_ansible:
# These are usually set within another role using _venv_path and _venv_command but can be overridden.
# These are usually set within another role using _venv_path, _venv_command and _install_username but can be overridden.
#venv_path: "/home/{{ ce_provision.username }}/ansible"
#venv_command: /usr/bin/python3.11 -m venv
#install_username: deploy # user to become when creating venv
upgrade:
enabled: true # create systemd timer to auto-upgrade Ansible
command: "{{ _venv_path }}/bin/python3 -m pip install --upgrade ansible" # if you set venv_path above then set it here too
Expand Down
7 changes: 4 additions & 3 deletions roles/debian/ansible/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
state: absent
executable: pip3
when: ansible_distribution_major_version | int < 12
failed_when: false # don't stop the build if there's no system pip

- name: Set up Python packages.
ansible.builtin.include_role:
Expand All @@ -23,7 +24,7 @@
virtualenv: "{{ ce_ansible.venv_path | default(_venv_path) }}"
virtualenv_command: "{{ ce_ansible.venv_command | default(_venv_command) }}"
become: true
become_user: "{{ ce_provision.username }}"
become_user: "{{ ce_ansible.install_username | default(_install_username) }}"

- name: Install Ansible.
ansible.builtin.pip:
Expand All @@ -32,7 +33,7 @@
virtualenv: "{{ ce_ansible.venv_path | default(_venv_path) }}"
virtualenv_command: "{{ ce_ansible.venv_command | default(_venv_command) }}"
become: true
become_user: "{{ ce_provision.username }}"
become_user: "{{ ce_ansible.install_username | default(_install_username) }}"

- name: Install linters.
ansible.builtin.pip:
Expand All @@ -43,7 +44,7 @@
virtualenv_command: "{{ ce_ansible.venv_command | default(_venv_command) }}"
when: ce_ansible.linters.enabled
become: true
become_user: "{{ ce_provision.username }}"
become_user: "{{ ce_ansible.install_username | default(_install_username) }}"

- name: Add the venv to $PATH using profile.d.
ansible.builtin.copy:
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ce_deploy:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_deploy.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_deploy.username }}"
# Other ce-deploy settings.
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
key_name: id_rsa.pub # existing users may have a key of a different name
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_deploy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ce_deploy:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_deploy.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_deploy.username }}"
# Other ce-deploy settings.
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
key_name: id_rsa.pub # existing users may have a key of a different name
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
ansible.builtin.set_fact:
_venv_path: "{{ ce_deploy.venv_path }}"
_venv_command: "{{ ce_deploy.venv_command }}"
_install_username: "{{ ce_deploy.install_username }}"

- name: Install Ansible.
ansible.builtin.include_role:
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_provision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ce_provision:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_provision.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_provision.username }}"
# Other ce-provision settings.
username: "{{ _ce_provision.username }}"
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_provision/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ce_provision:
# Location of Ansible installation and components.
venv_path: "/home/{{ _ce_provision.username }}/ansible"
venv_command: /usr/bin/python3 -m venv
install_username: "{{ _ce_provision.username }}"
# Other ce-provision settings.
username: "{{ _ce_provision.username }}"
new_user: true # set to false if user already exists or is ephemeral, e.g. an LDAP user
Expand Down
1 change: 1 addition & 0 deletions roles/debian/ce_provision/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
ansible.builtin.set_fact:
_venv_path: "{{ ce_provision.venv_path }}"
_venv_command: "{{ ce_provision.venv_command }}"
_install_username: "{{ ce_provision.install_username }}"

- name: Install Ansible.
ansible.builtin.include_role:
Expand Down
1 change: 1 addition & 0 deletions roles/debian/gitlab_runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ gitlab_runner:
# see https://gitlab.com/gitlab-org/ci-cd/custom-executor-drivers/fargate/-/tree/master/docs
fargate:
cluster: "my-cluster" # ECS cluster name
profile: "{{ _aws_profile }}"
region: "eu-west-1" # AWS region name
subnet: "subnet-abcdef123456" # subnet ID
security_group: "my-security-group" # SG name
Expand Down
1 change: 1 addition & 0 deletions roles/debian/gitlab_runner/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ gitlab_runner:
# see https://gitlab.com/gitlab-org/ci-cd/custom-executor-drivers/fargate/-/tree/master/docs
fargate:
cluster: "my-cluster" # ECS cluster name
profile: "{{ _aws_profile }}"
region: "eu-west-1" # AWS region name
subnet: "subnet-abcdef123456" # subnet ID
security_group: "my-security-group" # SG name
Expand Down
26 changes: 12 additions & 14 deletions roles/debian/gitlab_runner/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@
# gitlab-runner register --url https://gitlab.com/ --registration-token TOKEN_HERE --name fargate-test-runner --run-untagged --executor custom -n
# This will automatically update /etc/gitlab-runner/config.toml

# @TODO this needs rethinking, we cannot delegate include_role!
# Replace security_group in template with _aws_security_group_list[0] when resolved

# Populates the _aws_security_group_list variable used in fargate.toml.j2
#- name: Generate security group information.
# ansible.builtin.include_role:
# name: aws/aws_security_groups
# vars:
# profile: "{{ gitlab_runner.fargate.region }}"
# region: "{{ gitlab_runner.fargate.region }}"
# group_names:
# - "{{ gitlab_runner.fargate.security_group }}"
# return_type: ids
# when: gitlab_runner.install_fargate
# delegate_to: localhost
- name: Generate security group information.
ansible.builtin.include_role:
name: aws/aws_security_groups
apply:
delegate_to: localhost # this is how you delegate the include_role module
vars:
profile: "{{ gitlab_runner.fargate.profile }}"
region: "{{ gitlab_runner.fargate.region }}"
group_names:
- "{{ gitlab_runner.fargate.security_group }}"
return_type: ids
when: gitlab_runner.install_fargate

- name: Create the Fargate driver directory if it does not exist.
ansible.builtin.file:
Expand Down
2 changes: 1 addition & 1 deletion roles/debian/gitlab_runner/templates/fargate.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LogFormat = "text"
Cluster = "{{ gitlab_runner.fargate.cluster }}"
Region = "{{ gitlab_runner.fargate.region }}"
Subnet = "{{ gitlab_runner.fargate.subnet }}"
SecurityGroup = "{{ gitlab_runner.fargate.security_group }}"
SecurityGroup = "{{ _aws_security_group_list[0] }}"
TaskDefinition = "{{ gitlab_runner.fargate.task_definition }}"
EnablePublicIP = {{ gitlab_runner.fargate.public_ip }}
PlatformVersion = "{{ gitlab_runner.fargate.version }}"
Expand Down