From 3468e34364b12b9d7d14d32d4c6695ec7b9d9a80 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Verissimo Date: Wed, 23 May 2018 10:48:32 -0300 Subject: [PATCH 1/3] Enable a cups server to be used in this roles Fix #27 --- defaults/main.yml | 4 +++- templates/smb.conf.j2 | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c786d30..628ed24 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,4 @@ -# roles/samba/defaults/main.yml +#i roles/samba/defaults/main.yml --- samba_workgroup: 'WORKGROUP' @@ -9,6 +9,8 @@ samba_security: 'user' samba_passdb_backend: 'tdbsam' samba_map_to_guest: 'bad user' samba_load_printers: false +samba_printer_type: 'cups' +samba_cups_server: 'localhost:631' samba_load_homes: false samba_create_varwww_symlinks: false samba_shares_root: '/srv/shares' diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index 27e8fa5..b672535 100755 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -59,6 +59,13 @@ printing = bsd printcap name = /dev/null disable spoolss = yes +{% else %} + load printers = yes + printing = {{ samba_printer_type }} + printcap name = {{ samba_printer_type }} + {% if not samba_printer_type == 'cups' %} + cups server = {{ samba_cups_server }} + {% else %} {% endif %} {% if samba_mitigate_cve_2017_7494 %} From 5089cd887ae164325eed89ba47d6485f35b68aad Mon Sep 17 00:00:00 2001 From: Thiago Gomes Verissimo Date: Wed, 23 May 2018 10:48:32 -0300 Subject: [PATCH 2/3] Enable a cups server to be used in this roles Fix #27 --- defaults/main.yml | 4 +++- templates/smb.conf.j2 | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c786d30..628ed24 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,4 @@ -# roles/samba/defaults/main.yml +#i roles/samba/defaults/main.yml --- samba_workgroup: 'WORKGROUP' @@ -9,6 +9,8 @@ samba_security: 'user' samba_passdb_backend: 'tdbsam' samba_map_to_guest: 'bad user' samba_load_printers: false +samba_printer_type: 'cups' +samba_cups_server: 'localhost:631' samba_load_homes: false samba_create_varwww_symlinks: false samba_shares_root: '/srv/shares' diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index 27e8fa5..067f480 100755 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -59,6 +59,13 @@ printing = bsd printcap name = /dev/null disable spoolss = yes +{% else %} + load printers = yes + printing = {{ samba_printer_type }} + printcap name = {{ samba_printer_type }} + {% if not samba_printer_type == 'cups' %} + cups server = {{ samba_cups_server }} + {% endif %} {% endif %} {% if samba_mitigate_cve_2017_7494 %} From 8cc7cd0286b3a8cf541ca7edd84dacb8f0906dd3 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Verissimo Date: Wed, 23 May 2018 10:57:01 -0300 Subject: [PATCH 3/3] fix if stmt --- templates/smb.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2 index 067f480..2273a74 100755 --- a/templates/smb.conf.j2 +++ b/templates/smb.conf.j2 @@ -63,7 +63,7 @@ load printers = yes printing = {{ samba_printer_type }} printcap name = {{ samba_printer_type }} - {% if not samba_printer_type == 'cups' %} + {% if samba_printer_type == 'cups' %} cups server = {{ samba_cups_server }} {% endif %} {% endif %}