A Primark security guard who posted Islamic State propaganda videos and shared images of himself masked and wielding a large knife has been jailed.