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

Commit 04ce30b

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 fb0b565 commit 04ce30b

File tree

3 files changed

+144
-144
lines changed

3 files changed

+144
-144
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@
1515

1616
- role: zim_install
1717
when: ansible_local.device_list[generic_project_name].zim_install is defined
18-
and ansible_local.device_list[generic_project_name].zim_install.activated|bool == True
18+
and ansible_local.device_list[generic_project_name].zim_install.activated
1919
tags: ['custom', 'update','zim_install']
2020

2121
- role: mook
2222
mook_name: bsfcampus
2323
mook_version: "{{ ansible_local.device_list[generic_project_name].bsfcampus.version }}"
2424
when: ansible_local.device_list[generic_project_name].bsfcampus is defined
25-
and ansible_local.device_list[generic_project_name].bsfcampus.activated|bool == True
25+
and ansible_local.device_list[generic_project_name].bsfcampus.activated
2626

2727
- role: mook
2828
mook_name: koombookedu
2929
mook_version: "{{ ansible_local.device_list[generic_project_name].koombookedu.version }}"
3030
when: ansible_local.device_list[generic_project_name].koombookedu is defined
31-
and ansible_local.device_list[generic_project_name].koombookedu.activated|bool == True
31+
and ansible_local.device_list[generic_project_name].koombookedu.activated
3232

3333
- role: appinventor
3434
when: ansible_local.device_list[generic_project_name].appinventor is defined
35-
and ansible_local.device_list[generic_project_name].appinventor.activated|bool == True
35+
and ansible_local.device_list[generic_project_name].appinventor.activated
3636
tags: ['custom']
3737

3838
- role: kalite
3939
when: ansible_local.device_list[generic_project_name].kalite is defined
40-
and ansible_local.device_list[generic_project_name].kalite.activated|bool == True
40+
and ansible_local.device_list[generic_project_name].kalite.activated
4141

4242
- role: logs
4343
when: ansible_local.installed_software.management.managed_by_bsf|bool == True
4444

4545
- role: idc_import
4646
when: ansible_local.device_list[generic_project_name].idc_import is defined
47-
and ansible_local.device_list[generic_project_name].idc_import.activated|bool == True
47+
and ansible_local.device_list[generic_project_name].idc_import.activated
4848
and ansible_default_ipv4.gateway == "{{ gateway }}"
49-
tags: ['custom', 'update','idc_import']
49+
tags: ['custom', 'update','idc_import']

0 commit comments

Comments
 (0)