File tree 5 files changed +73
-0
lines changed
templates/config.runners.autoscaler
5 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 1040
1040
- restart_gitlab_runner
1041
1041
- restart_gitlab_runner_macos
1042
1042
1043
+ # ### [runners.autoscaler] section ####
1044
+
1045
+ - name : " Set autoscaler section {{ runn_name_prefix }}"
1046
+ ansible.builtin.blockinfile :
1047
+ dest : " {{ temp_runner_config.path }}"
1048
+ content : " {{ lookup('template', 'config.runners.autoscaler/autoscaler.j2') if gitlab_runner.autoscaler is defined }}"
1049
+ state : " {{ 'present' if gitlab_runner.autoscaler is defined else 'absent' }}"
1050
+ marker : " # {mark} runners.autoscaler"
1051
+ insertafter : EOF
1052
+ check_mode : false
1053
+ no_log : " {{ gitlab_runner_no_log_secrets | default(omit) }}"
1054
+ notify :
1055
+ - restart_gitlab_runner
1056
+ - restart_gitlab_runner_macos
1057
+
1043
1058
# ### [[runners.machine.autoscaling]] section ####
1044
1059
1045
1060
- name : " Set additional autoscaling option {{ runn_name_prefix }}"
Original file line number Diff line number Diff line change
1
+ [runners.autoscaler]
2
+ plugin = "{{ gitlab_runner.autoscaler.plugin }}" # for >= 16.11, ensure you run `gitlab-runner fleeting install` to automatically install the plugin
3
+ capacity_per_instance = {{ gitlab_runner.autoscaler.capacity_per_instance }}
4
+ max_use_count = {{ gitlab_runner.autoscaler.max_use_count }}
5
+ max_instances = {{ gitlab_runner.autoscaler.max_instances }}
6
+
7
+ {{ lookup('template', 'config.runners.autoscaler/fleeting.plugin.' ~ gitlab_runner.autoscaler.plugin ~ '.j2') }}
8
+
9
+ [runners.autoscaler.connector_config]
10
+ {% for key , value in gitlab_runner .autoscaler .connector_config .items () %}
11
+ {{ key }} = {{ '"' ~ value ~ '"' if value is string else value | lower if value is boolean else value }}
12
+ {% endfor %}
13
+
14
+ {% for policy in gitlab_runner .autoscaler .policies %}
15
+ [[runners.autoscaler.policy]]
16
+ {% for key , value in policy .items () %}
17
+ {{ key }} = {{ '"' ~ value ~ '"' if value is string else value | lower if value is boolean else value }}
18
+ {% endfor %}
19
+ {% endfor %}
Original file line number Diff line number Diff line change
1
+ [runners.autoscaler.plugin_config]
2
+ {% if gitlab_runner .autoscaler .plugin_config .name is defined %}
3
+ name = "{{ gitlab_runner.autoscaler.plugin_config.name }}"
4
+ {% endif %}
5
+ {% if gitlab_runner .autoscaler .plugin_config .profile is defined %}
6
+ profile = "{{ gitlab_runner.autoscaler.plugin_config.profile }}"
7
+ {% endif %}
8
+ {% if gitlab_runner .autoscaler .plugin_config .config_file is defined %}
9
+ config_file = "{{ gitlab_runner.autoscaler.plugin_config.config_file }}"
10
+ {% endif %}
11
+ {% if gitlab_runner .autoscaler .plugin_config .credentials_file is defined %}
12
+ credentials_file = "{{ gitlab_runner.autoscaler.plugin_config.credentials_file }}"
13
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ [runners.autoscaler.plugin_config]
2
+ {% if gitlab_runner .autoscaler .plugin_config .name is defined %}
3
+ name = "{{ gitlab_runner.autoscaler.plugin_config.name }}"
4
+ {% endif %}
5
+ {% if gitlab_runner .autoscaler .plugin_config .subscription_id is defined %}
6
+ subscription_id = "{{ gitlab_runner.autoscaler.plugin_config.subscription_id }}"
7
+ {% endif %}
8
+ {% if gitlab_runner .autoscaler .plugin_config .resource_group_name is defined %}
9
+ resource_group_name = "{{ gitlab_runner.autoscaler.plugin_config.resource_group_name }}"
10
+ {% endif %}
Original file line number Diff line number Diff line change
1
+ [runners.autoscaler.plugin_config]
2
+ {% if gitlab_runner .autoscaler .plugin_config .name is defined %}
3
+ name = "{{ gitlab_runner.autoscaler.plugin_config.name }}"
4
+ {% endif %}
5
+ {% if gitlab_runner .autoscaler .plugin_config .project is defined %}
6
+ project = "{{ gitlab_runner.autoscaler.plugin_config.project }}"
7
+ {% endif %}
8
+ {% if gitlab_runner .autoscaler .plugin_config .zone is defined %}
9
+ zone = "{{ gitlab_runner.autoscaler.plugin_config.zone }}"
10
+ {% endif %}
11
+ {% if gitlab_runner .autoscaler .plugin_config .credentials_file is defined %}
12
+ credentials_file = "{{ gitlab_runner.autoscaler.plugin_config.credentials_file }}"
13
+ {% endif %}
14
+ {% if gitlab_runner .autoscaler .plugin_config .endpoint is defined %}
15
+ endpoint = "{{ gitlab_runner.autoscaler.plugin_config.endpoint }}"
16
+ {% endif %}
You can’t perform that action at this time.
0 commit comments