Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 42c7e4c

Browse files
author
Mathieu Bridon
committed
Use real JSON booleans
No need to compare the "True" and "False" strings, when we can use actual boolean values.
1 parent 3b0680a commit 42c7e4c

File tree

3 files changed

+146
-146
lines changed

3 files changed

+146
-146
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,26 @@ Please have a look at others configurations files to see how it has been done. W
4343
- Add a new JSON section to describe what must be installed on your device. **This is JSON syntax, comma and quote a really important!**
4444
- **kb-gin-conakry** is the name of your device
4545
- **kalite** is the name of the role played but also the name of the application we want to install
46-
- **activated** Whether we want install or not the application. If True, the application will be installed and configured on the target device. If leaved True, the target device will be updated continuously at each time the later will be connected on Internet
46+
- **activated** Whether we want install or not the application. If true, the application will be installed and configured on the target device. If leaved true, the target device will be updated continuously at each time the later will be connected on Internet
4747
- **version** For some application it is better to lock the version number instead of installing always the last version. A new version has always to be tested before deployment.
4848
- **language** You can specify the language you wish to use (must be on 2 letters)
4949
```
5050
"kb-bsfcampus-sen": {
5151
"bsfcampus": {
52-
"activated": "True",
52+
"activated": true,
5353
"version": "100816"
5454
},
5555
"kalite": {
56-
"activated": "True",
56+
"activated": true,
5757
"version": "0.16.8",
5858
"language": ["fr"]
5959
},
6060
"idc_import": {
61-
"activated": "True",
61+
"activated": true,
6262
"content_name": ["2-Contenus/Logiciel-libre/app.csv","21-BSFCAMPUS/KB_Liste_contenus_bsf_campus.csv"]
6363
},
6464
"zim_install": {
65-
"activated": "True",
65+
"activated": true,
6666
"name": "ubuntudoc.fr tedxlausanne2014.fr tedxlausanne2013.fr tedxlausanne2012.fr tedxgeneva2014.fr cest-pas-sorcier.fr gutenberg.fr vikidia.fr wikisource.en wikisource.fr wikipedia.fr wikipedia.wo wikipedia.en "
6767
}
6868
},
@@ -143,14 +143,14 @@ Ansible will be executed in Pull mode and this file will be called by Network-Ma
143143
144144
Example of `ansiblePullUpdate`: `/usr/local/bin/ansible-pull -s 120 -d /var/lib/ansible/local -C oneUpdateFile -i hosts -U https://github.com/ideascube/ansiblecube.git main.yml --tags "update"`
145145
146-
From now on, everything depend from the file `roles/set_custom_fact/files/device_list.fact`. If you left some application with `"activated": "True",` those ones will be updated each time the device will be connected to Internet.
146+
From now on, everything depend from the file `roles/set_custom_fact/files/device_list.fact`. If you left some application with `"activated": true,` those ones will be updated each time the device will be connected to Internet.
147147
148148
## Available TAGS
149149
150150
- idc_import: Call the ideascube import medias command with the right file given with
151151
```
152152
"idc_import": {
153-
"activated": "True",
153+
"activated": true,
154154
"content_name": ["2-Contenus/Logiciel-libre/app.csv","21-BSFCAMPUS/KB_Liste_contenus_bsf_campus.csv"]
155155
},
156156
```

main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,36 @@
2424

2525
- role: zim_install
2626
when: ansible_local.device_list[generic_project_name].zim_install is defined
27-
and ansible_local.device_list[generic_project_name].zim_install.activated|bool == True
27+
and ansible_local.device_list[generic_project_name].zim_install.activated
2828
tags: ['custom', 'update','zim_install']
2929

3030
- role: mook
3131
mook_name: bsfcampus
3232
mook_version: "{{ ansible_local.device_list[generic_project_name].bsfcampus.version }}"
3333
when: ansible_local.device_list[generic_project_name].bsfcampus is defined
34-
and ansible_local.device_list[generic_project_name].bsfcampus.activated|bool == True
34+
and ansible_local.device_list[generic_project_name].bsfcampus.activated
3535

3636
- role: mook
3737
mook_name: koombookedu
3838
mook_version: "{{ ansible_local.device_list[generic_project_name].koombookedu.version }}"
3939
when: ansible_local.device_list[generic_project_name].koombookedu is defined
40-
and ansible_local.device_list[generic_project_name].koombookedu.activated|bool == True
40+
and ansible_local.device_list[generic_project_name].koombookedu.activated
4141

4242
- role: appinventor
4343
when: ansible_local.device_list[generic_project_name].appinventor is defined
44-
and ansible_local.device_list[generic_project_name].appinventor.activated|bool == True
44+
and ansible_local.device_list[generic_project_name].appinventor.activated
4545
tags: ['custom']
4646

4747
- role: kalite
4848
when: ansible_local.device_list[generic_project_name].kalite is defined
49-
and ansible_local.device_list[generic_project_name].kalite.activated|bool == True
49+
and ansible_local.device_list[generic_project_name].kalite.activated
5050

5151
- role: logs
5252
when: ansible_local.installed_software.management.managed_by_bsf|bool == True
5353

5454
- role: idc_import
5555
when: ansible_local.device_list[generic_project_name].idc_import is defined
56-
and ansible_local.device_list[generic_project_name].idc_import.activated|bool == True
56+
and ansible_local.device_list[generic_project_name].idc_import.activated
5757
and ansible_default_ipv4.gateway == "{{ gateway }}"
5858
tags: ['update','idc_import']
5959

0 commit comments

Comments
 (0)