|
1 | 1 | --- |
2 | 2 | - name: Add system user |
3 | 3 | user: |
4 | | - name: "{{ system_user }}" |
| 4 | + name: "{{ react_system_user }}" |
5 | 5 | shell: /bin/bash |
6 | | - group: "{{ system_group }}" |
| 6 | + group: "{{ react_system_group }}" |
7 | 7 | append: yes |
8 | 8 | createhome: yes |
9 | 9 |
|
|
20 | 20 | become_user: root |
21 | 21 |
|
22 | 22 | - name: Download node |
23 | | - shell: curl -sL https://deb.nodesource.com/setup_{{ node_version }} | sudo -E bash - |
| 23 | + shell: curl -sL https://deb.nodesource.com/setup_{{ react_node_version }} | sudo -E bash - |
24 | 24 | become: True |
25 | 25 | become_user: root |
26 | 26 | args: |
|
32 | 32 |
|
33 | 33 | - name: Install system-wide dependencies |
34 | 34 | apt: |
35 | | - name: "{{ system_wide_dependencies }}" |
| 35 | + name: "{{ react_system_wide_dependencies }}" |
36 | 36 | state: latest |
37 | 37 | update_cache: yes |
38 | 38 | cache_valid_time: 600 |
39 | 39 |
|
40 | 40 | - name: Ensure required directories are present |
41 | 41 | file: |
42 | 42 | state: directory |
43 | | - owner: "{{ system_user }}" |
| 43 | + owner: "{{ react_system_user }}" |
44 | 44 | group: www-data |
45 | 45 | path: "{{ item }}" |
46 | 46 | when: |
47 | 47 | - item is defined |
48 | 48 | - item is not none |
49 | 49 | with_items: |
50 | | - - "{{ versioned_path }}" |
51 | | - - "{{ checkout_path }}" |
52 | | - - "{{ system_user_home }}/.ssh" |
| 50 | + - "{{ react_versioned_path }}" |
| 51 | + - "{{ react_checkout_path }}" |
| 52 | + - "{{ react_system_user_home }}/.ssh" |
53 | 53 |
|
54 | 54 | - name: Git clone without key |
55 | 55 | git: |
56 | 56 | accept_hostkey: "yes" |
57 | | - repo: "{{ git_url }}" |
58 | | - dest: "{{ checkout_path }}" |
59 | | - version: "{{ git_version }}" |
| 57 | + repo: "{{ react_git_url }}" |
| 58 | + dest: "{{ react_checkout_path }}" |
| 59 | + version: "{{ react_git_version }}" |
60 | 60 | depth: 1 |
61 | 61 | become: True |
62 | | - become_user: "{{ system_user }}" |
| 62 | + become_user: "{{ react_system_user }}" |
63 | 63 | when: |
64 | | - - git_key is not defined or git_key is none |
| 64 | + - react_git_key is not defined or react_git_key is none |
65 | 65 |
|
66 | 66 | - name: Copy git key |
67 | 67 | copy: |
68 | | - content: "{{ git_key }}" |
69 | | - dest: "{{ system_user_home }}/.ssh/{{ git_key_filename }}" |
70 | | - owner: "{{ system_user }}" |
| 68 | + content: "{{ react_git_key }}" |
| 69 | + dest: "{{ react_system_user_home }}/.ssh/{{ react_git_key_filename }}" |
| 70 | + owner: "{{ react_system_user }}" |
71 | 71 | mode: 0600 |
72 | 72 | no_log: False |
73 | 73 | when: |
74 | | - - git_key is defined |
75 | | - - git_key is not none |
| 74 | + - react_git_key is defined |
| 75 | + - react_git_key is not none |
76 | 76 |
|
77 | 77 | - name: Git clone with key |
78 | 78 | git: |
79 | 79 | accept_hostkey: "yes" |
80 | | - repo: "{{ git_url }}" |
81 | | - dest: "{{ checkout_path }}" |
82 | | - version: "{{ git_version }}" |
| 80 | + repo: "{{ react_git_url }}" |
| 81 | + dest: "{{ react_checkout_path }}" |
| 82 | + version: "{{ react_git_version }}" |
83 | 83 | depth: 1 |
84 | | - key_file: "{{ system_user_home }}/.ssh/{{ git_key_filename }}" |
| 84 | + key_file: "{{ react_system_user_home }}/.ssh/{{ react_git_key_filename }}" |
85 | 85 | become: True |
86 | | - become_user: "{{ system_user }}" |
| 86 | + become_user: "{{ react_system_user }}" |
87 | 87 | when: |
88 | | - - git_key is defined |
89 | | - - git_key is not none |
| 88 | + - react_git_key is defined |
| 89 | + - react_git_key is not none |
90 | 90 |
|
91 | 91 | - name: Remove Git Key |
92 | 92 | file: |
93 | 93 | state: absent |
94 | | - path: "{{ system_user_home }}/.ssh/{{ git_key_filename }}" |
| 94 | + path: "{{ react_system_user_home }}/.ssh/{{ react_git_key_filename }}" |
95 | 95 | become: True |
96 | | - become_user: "{{ system_user }}" |
| 96 | + become_user: "{{ react_system_user }}" |
97 | 97 | when: |
98 | | - - git_key is defined |
99 | | - - git_key is not none |
100 | | - - remove_git_key == True |
| 98 | + - react_git_key is defined |
| 99 | + - react_git_key is not none |
| 100 | + - react_remove_git_key == True |
0 commit comments