The consumer-price index rose 2.7% from a year earlier, a sign that the path to bringing down price pressures remains bumpy.