StreisandEffect / streisand

Streisand sets up a new server running your choice of WireGuard, OpenConnect, OpenSSH, OpenVPN, Shadowsocks, sslh, Stunnel, or a Tor bridge. It also generates custom instructions for all of these services. At the end of the run you are given an HTML file with instructions that can be shared with friends, family members, and fellow activists.
https://twitter.com/streisandvpn
Other
23.15k stars 1.99k forks source link

Ad block install failed #1646

Open kx-chen opened 4 years ago

kx-chen commented 4 years ago

Expected behavior:

Ad blocking installs properly.

Actual Behavior:

Fails with following error:

fatal: [157.245.189.107]: FAILED! => {"msg": "The conditional check 'streisand_ad_blocking_enabled' failed. The error was: error while evaluating conditional (streisand_ad_blocking_enabled): 'y' is undefined\n\nThe error appears to be in '/Users/kai/vpn/streisand/playbooks/roles/ad-blocking/tasks/main.yml': line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Install blocklist tools\"\n  ^ here\n"}

Steps to Reproduce:

I used the fresh digital ocean droplet created by streisand and installed with most options default with the exception of adblocking.

Ansible Information

Streisand Information

Enabled Roles

nopdotcom commented 4 years ago

My first guess is that something is being picky about y vs yes. Try using full yes and no and see if that works for you.

If it doesn't, maybe we have some other kind of skew. Could you run this for me?

$ ansible-config dump --only-changed
ANSIBLE_PIPELINING(/Users/nop/gh/nop-streisand/ansible.cfg) = True
DEFAULT_HOST_LIST(/Users/nop/gh/nop-streisand/ansible.cfg) = [u'/Users/nop/gh/nop-streisand/inventories/inventory']
DEFAULT_LOCAL_TMP(/Users/nop/gh/nop-streisand/ansible.cfg) = /Users/nop/.ansible/tmp/ansible-local-95409ek9gXJ
DEFAULT_MODULE_PATH(/Users/nop/gh/nop-streisand/ansible.cfg) = [u'/Users/nop/gh/nop-streisand/library']
DEFAULT_TIMEOUT(/Users/nop/gh/nop-streisand/ansible.cfg) = 100
HOST_KEY_CHECKING(/Users/nop/gh/nop-streisand/ansible.cfg) = False
$ 
kx-chen commented 4 years ago

Thanks, I'll try with using yes later today and let you know. :)

jademonkey33 commented 4 years ago

I was able to get this to work on a DO droplet. My configuration options were slightly different;

I also explicitly used 'yes' and 'no' during any prompt entry. My ansible version is the same as the original poster, but my python version is 2.7.12

I will attempt to spin up another instance to mirror the configuration choices of the initial poster to isolate variables later today.

changchichung commented 4 years ago

Streisand install failed on google cloud instance after enabling customization and attempting to enable ad block and OpenVPN. At failure, long pause again at NGINX and then "failed to install."

yes , I have the same problem , install hangs longtime at nginx then failed. I had enable ad block , but no OpenVPN.

so I run again , disabled ad block , and the script works.

hope that problem can be fixed.

changchichung commented 4 years ago

according to the ansible error messages , nginx install failed due to temporally dns resolve error , and nameserver was assigned to 127.0.0.1 in /etc/resolv.conf so I add this task in stresiand/playbooks/roles/nginx/task/main.yml it's ugly , but it's working.

- name: replace nameserver in /etc/resolv.conf , or nginx will hang like forever and failed
  lineinfile:
    path: /etc/resolv.conf
    regexp: 'nameserver'
    line: 'nameserver 8.8.8.8'                                                                 
    state: present

now , I can run the script with ad-block enabled .

TheNomad11 commented 4 years ago

@holderad Ad-blocking is optional and the default is No, that is a good compromise, I think. It worked well with a VPS and I am amazed by and thankful for this feature. Installing Pi-Hole can be a hassle (especially combined with Streisand, I only made it work by de-installing nginx because of conflicts).

EntropiaFox commented 4 years ago

@changchichung 's tweak did the trick while installing Streisand with ad-blocking enabled-- I had been racking my brains for an entire day trying to figure out what the exact issue was, to the point of even trying a different VPS.