Commit 96ddeb7b authored by nanahira's avatar nanahira

new

parent 607a35e2
...@@ -20,10 +20,24 @@ ...@@ -20,10 +20,24 @@
remove_orphans: true remove_orphans: true
build: false build: false
pull: '{{pull}}' pull: '{{pull}}'
- name: check avx2
command: lscpu | grep avx2
register: avx2_check
failed_when: false
changed_when: false
when: ansible_architecture == 'x86_64'
- name: use avx2
set_fact:
avx2_tag: 'avx2'
when: ansible_architecture == 'x86_64' and avx2_check.stdout != ''
- name: use no avx2
set_fact:
avx2_tag: 'noavx2'
when: ansible_architecture == 'x86_64' and avx2_check.stdout == ''
- name: register - name: register
shell: | shell: |
{% for instance in instances %} {% for instance in instances %}
docker-compose exec -T runner gitlab-runner register --non-interactive --url '{{ instance.url }}' --registration-token '{{ instance.token }}' --description '{{ instance.desc }} runner on {{ inventory_hostname }}' --executor '{{ instance.type | default("docker") }}' --docker-volumes /cache {% if instance.docker | default(false) %} --tag-list docker{% if ansible_architecture == 'aarch64' %}-arm{% endif %} --docker-privileged --docker-volumes /var/run/docker.sock:/var/run/docker.sock --docker-image docker:{{ docker_version | default(25) }}-git {% else %} --tag-list {% if ansible_architecture == 'aarch64' %}arm{% else %}linux{% endif %} --docker-image git-registry.moenext.com/mycard/docker-runner-base:latest {% endif %} docker-compose exec -T runner gitlab-runner register --non-interactive --url '{{ instance.url }}' --registration-token '{{ instance.token }}' --description '{{ instance.desc }} runner on {{ inventory_hostname }}' --executor '{{ instance.type | default("docker") }}' --docker-volumes /cache {% if instance.docker | default(false) %} --tag-list docker{% if ansible_architecture == 'aarch64' %}-arm{% else %},docker-{{avx2_tag}}{% endif %} --docker-privileged --docker-volumes /var/run/docker.sock:/var/run/docker.sock --docker-image docker:{{ docker_version | default(25) }}-git {% else %} --tag-list {% if ansible_architecture == 'aarch64' %}arm{% else %}linux,{{avx2_tag}}{% endif %} --docker-image git-registry.moenext.com/mycard/docker-runner-base:latest {% endif %}
{% endfor %} {% endfor %}
args: args:
......
...@@ -97,16 +97,9 @@ ...@@ -97,16 +97,9 @@
state: stopped state: stopped
enabled: false enabled: false
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat'
- name: permission for home path
become: true
file:
path: '{{home_path}}'
state: directory
owner: '{{ansible_user_id}}'
group: '{{ansible_user_id}}'
- name: pool directories - name: pool directories
file: file:
path: '{{home_path}}/{{item}}' path: '{{ansible_user_dir}}/{{item}}'
state: directory state: directory
with_items: with_items:
- iso - iso
......
---
- hosts: init
remote_user: root
tasks:
- name: rerun sysctl
include_tasks: roles/init/tasks/sysctl.yml
...@@ -33,16 +33,20 @@ ...@@ -33,16 +33,20 @@
copy: '{{item}}' copy: '{{item}}'
with_items: '{{ specific_files }}' with_items: '{{ specific_files }}'
notify: handle notify: handle
- name: Get list of full path template files (*.j2) for the service
set_fact:
template_list: "{{ lookup('fileglob', 'files/services/' + service_name + '/templates/*.j2', wantlist=True) }}"
- name: templates - name: templates
become: true become: true
with_items: '{{ template_list }}' with_items: '{{ template_list }}'
template: template:
src: 'files/services/{{ service_name }}/templates/{{ item }}.j2' src: '{{ item }}'
dest: '{{ ansible_user_dir }}/{{ service_path }}/templates/{{ item }}' dest: "{{ ansible_user_dir }}/{{ service_path }}/templates/{{ item | basename | regex_replace('\\.j2$', '') }}"
owner: '{{ ansible_user_id }}' owner: '{{ ansible_user_id }}'
group: '{{ ansible_user_id }}' group: '{{ ansible_user_id }}'
follow: yes follow: yes
notify: handle notify: handle
when: service_name != "frpc"
- name: templates for frpc - name: templates for frpc
become: true become: true
with_items: '{{ frpc_instances }}' with_items: '{{ frpc_instances }}'
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
track_submodules: true track_submodules: true
- name: premake5 - name: premake5
unarchive: unarchive:
src: https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-linux.tar.gz src: https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta4-linux.tar.gz
dest: '{{ygopro_path}}/' dest: '{{ygopro_path}}/'
creates: '{{ygopro_path}}/premake5' creates: '{{ygopro_path}}/premake5'
remote_src: true remote_src: true
- name: download lua - name: download lua
unarchive: unarchive:
src: https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.3.6.tar.gz src: https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.4.4.tar.gz
dest: /tmp/ dest: /tmp/
creates: /tmp/lua-5.3.6 creates: /tmp/lua-5.4.4
remote_src: true remote_src: true
when: ansible_os_family != 'Debian' when: ansible_os_family != 'Debian'
- name: move lua - name: move lua
shell: 'cp -rf /tmp/lua-5.3.6 {{ygopro_path}}/lua ; cp -rf {{ygopro_path}}/premake/lua/premake5.lua {{ygopro_path}}/lua/' shell: 'cp -rf /tmp/lua-5.4.4 {{ygopro_path}}/lua ; cp -rf {{ygopro_path}}/premake/lua/premake5.lua {{ygopro_path}}/lua/'
args: args:
creates: '{{ygopro_path}}/lua/premake5.lua' creates: '{{ygopro_path}}/lua/premake5.lua'
when: ansible_os_family != 'Debian' when: ansible_os_family != 'Debian'
...@@ -40,6 +40,14 @@ ...@@ -40,6 +40,14 @@
set_fact: set_fact:
premake_params: '{{premake_params}} --lua-deb' premake_params: '{{premake_params}} --lua-deb'
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- name: remove old build dirs
file:
name: '{{ygopro_path}}/{{item}}'
state: absent
with_items:
- bin
- obj
- build
- name: premake5 gmake - name: premake5 gmake
shell: './premake5 gmake {{premake_params}}' shell: './premake5 gmake {{premake_params}}'
args: args:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment